[fpc-pascal] command and variable substitution in fpcmake

Peter Vreman peter at freepascal.org
Wed Aug 1 22:21:41 CEST 2007


At 22:03 1-8-2007, you wrote:
>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
>replacement at all. I 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




More information about the fpc-pascal mailing list