Makefile

View: New views
6 Messages — Rating Filter:   Alert me  

Makefile

by paramaniac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Octave Community

I added a Makefile to the new control-oo package. At the moment, "pkg  
install" copies all the necessary files, but it doesn't add the  
enclosing directories to Octave's path.

http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/Makefile?revision=6339&view=markup

The "pkg install" command should add the following directories to the  
path:
inst/
inst/control
inst/ocst

but it should not add the @* directories in inst/
in order to load the package correctly when octave starts up.
Which commands do I need to achieve this?
Thanks for any help.

Regards,
Lukas

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: Makefile

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

man, 19 10 2009 kl. 18:10 +0200, skrev Lukas Reichlin:
> The "pkg install" command should add the following directories to the  
> path:
> inst/
> inst/control
> inst/ocst
>
> but it should not add the @* directories in inst/
> in order to load the package correctly when octave starts up.
> Which commands do I need to achieve this?

If you add a file 'inst/PKG_ADD' then this will be executed one your
package is loaded. You can put commands in this file that will setup the
paths for you. You can add something like

  addpath (fullfile (pwd (), fileparts (mfilename ("fullpath")),
"control"));

but I'm sure there must be a more simple way.

Søren


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: Makefile

by paramaniac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your help, Søren.

addpath(fullfile (fileparts (mfilename ("fullpath")), "control"));
addpath(fullfile (fileparts (mfilename ("fullpath")), "ocst"));
seems to work when I add the PKG_ADD file manually to inst/ after  
installation.

Therefore, I put the PKG-ADD file in
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/inst/

However, after downloading the tarball and using "pkg install",  
PKG_ADD is not in place. Do you know how to fix this?

Regards,
Lukas

> man, 19 10 2009 kl. 18:10 +0200, skrev Lukas Reichlin:
>> The "pkg install" command should add the following directories to the
>> path:
>> inst/
>> inst/control
>> inst/ocst
>>
>> but it should not add the @* directories in inst/
>> in order to load the package correctly when octave starts up.
>> Which commands do I need to achieve this?
>
> If you add a file 'inst/PKG_ADD' then this will be executed one your
> package is loaded. You can put commands in this file that will setup  
> the
> paths for you. You can add something like
>
> addpath (fullfile (pwd (), fileparts (mfilename ("fullpath")),
> "control"));
>
> but I'm sure there must be a more simple way.
>
> Søren
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Parent Message unknown Re: Makefile

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

tir, 20 10 2009 kl. 12:47 +0200, skrev Lukas Reichlin:

> addpath(fullfile (fileparts (mfilename ("fullpath")), "control"));
> addpath(fullfile (fileparts (mfilename ("fullpath")), "ocst"));
> seems to work when I add the PKG_ADD file manually to inst/ after  
> installation.
>
> Therefore, I put the PKG-ADD file in
> http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/inst/
>
> However, after downloading the tarball and using "pkg install",  
> PKG_ADD is not in place. Do you know how to fix this?

I must admit I can't remember the details. I see that the 'gsl' package
puts its PKG_ADD file in the root directory of the package, i.e. in the
directory that contains the 'inst' directory. You can try doing that and
see if that helps.

Søren


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: Makefile

by paramaniac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 20.10.2009, at 21:11, Søren Hauberg wrote:

> tir, 20 10 2009 kl. 12:47 +0200, skrev Lukas Reichlin:
>> addpath(fullfile (fileparts (mfilename ("fullpath")), "control"));
>> addpath(fullfile (fileparts (mfilename ("fullpath")), "ocst"));
>> seems to work when I add the PKG_ADD file manually to inst/ after
>> installation.
>>
>> Therefore, I put the PKG-ADD file in
>> http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/inst/
>>
>> However, after downloading the tarball and using "pkg install",
>> PKG_ADD is not in place. Do you know how to fix this?
>
> I must admit I can't remember the details. I see that the 'gsl'  
> package
> puts its PKG_ADD file in the root directory of the package, i.e. in  
> the
> directory that contains the 'inst' directory. You can try doing that  
> and
> see if that helps.
>
> Søren
>

I moved the file to the root directory and added "PKG_ADD to the  
Makefile
sinclude ../../Makeconf

PKG_FILES = COPYING DESCRIPTION INDEX PKG_ADD $(wildcard inst/*)
SUBDIRS = doc/

.PHONY: $(SUBDIRS)

pre-pkg::
        @for _dir in $(SUBDIRS); do \
          $(MAKE) -C $$_dir all; \
        done

clean:
        @for _dir in $(SUBDIRS); do \
          $(MAKE) -C $$_dir $(MAKECMDGOALS); \
        done

It works now, by some "magic" the file is moved to inst/
Thank you very much for your help!

Cheers,
Lukas
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

Re: Makefile

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

tir, 20 10 2009 kl. 22:29 +0200, skrev Lukas Reichlin:
> It works now, by some "magic" the file is moved to inst/

I think that magic is the package manager. When installing a package it
scans the source files for comments starting with 'PKG_ADD'. Whatever
follows such comments written to the end of the PKG_ADD file. So, you
can also put your PKG_ADD stuff in your source code if needed. (I'm just
writing this in case you're curious)

Søren


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev