Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-08

command and variable substitution in fpcmake

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

when using Makefiles something like this is executed at runtime, so a variable can be set by a command:

PWD=`pwd`

or

PDW=$(pwd)

sets the Varaible $PWD to the current path.

If one of both forms is used in a fpcmake-file that doesn't work.

[dist]
destdir=`pwd`/dist

If used that way, the string "`pwd`/dist" is copied as is with no didn't try the other form because it's the
variable syntax in fpcmake-files.

How can I make command execution work?

If used in a [prerules] section it does work, which is as expected because that section is only copied according to the manual.

TIA,
Marc

Peter Vreman
to Marc Santhoff
you wrote 27 lines
Hi, when using Makefiles something like this is executed at runtime, so a variable can be set by a command: PWD=`pwd` or PDW=$(pwd) sets the Varaible $PWD to the current path. If one of both forms is used in a fpcmake-file that doesn't work. [dist] destdir=`pwd`/dist If used that way, the string "`pwd`/dist" is copied as is with no didn't try the other form because it's the variable syntax in fpcmake-files. How can I make command execution work? If used in a [prerules] section it does work, which is as expected because that section is only copied according to the manual.

See the info page of make which functions are available. For shell execution:

PWD=$(shell pwd)

Peter

Marc Santhoff
to Peter Vreman
Peter Vreman wrote
>How can I make command execution work?

...

See the info page of make which functions are available. For shell execution: PWD=$(shell pwd)

Ah yes, that does it. Maybe the day will come when I like fpcmake. ;)

With "info page" I assume you meant the manpage and fpcmake(5) in fact does have a good and compact summary. I didn't know that it exists, it's a lot more handy than prog.pdf for every day use.

Many thanks,
Marc

Jonas Maebe
to Marc Santhoff
Marc Santhoff wrote 11 lines
Am Mittwoch, den 01.08.2007, 22:21 +0200 schrieb Peter Vreman: >> How can I make command execution work? ... > See the info page of make which functions are available. For shell > execution: > > PWD=$(shell pwd) Ah yes, that does it. Maybe the day will come when I like fpcmake. ;) With "info page" I assume you meant the manpage and fpcmake(5)

No, this is independent of fpcmake, it's about what (GNU) make uses/ supports. So I assume Peter was referring to "info make" (or presumably "info gmake" or "info gnumake" on FreeBSD).

Jonas

Marc Santhoff
to Jonas Maebe
Jonas Maebe wrote 17 lines
On 02 Aug 2007, at 01:41, Marc Santhoff wrote: > Am Mittwoch, den 01.08.2007, 22:21 +0200 schrieb Peter Vreman: >>> How can I make command execution work? > ... >> See the info page of make which functions are available. For shell >> execution: >> >> PWD=$(shell pwd) > > Ah yes, that does it. Maybe the day will come when I like fpcmake. ;) > > With "info page" I assume you meant the manpage and fpcmake(5) No, this is independent of fpcmake, it's about what (GNU) make uses/ supports. So I assume Peter was referring to "info make" (or presumably "info gmake" or "info gnumake" on FreeBSD).

I know and use that info page, but I have to admit that I didn't know the shell function yet (never needed it this way, using backticks or $() until now).

My main problem is to get an idea of how things are translated by fpcmake, but slowly I'm getting there.

Thanks a lot,
Marc