I have a question on a problem that is disturbing me for some
I want to set a variable in a Makefile by calling a shell
command. This usually is done like this:
SRC = `pwd`
But in this case, `pwd` will be evaluated for each usage
of the macro SRC. I only want the shell command to be evaluated
With GNU "make" I can use the following syntax:
SRC := $(shell pwd | sed 's:\(.*/src\)/.*:\1:')
In a directory "/home/heiner/src/misc" this will set
SRC to "/home/heiner/src".
Solaris "make" has the following syntax for the same purpose:
SRC:sh = pwd | sed 's:\(.*/src\)/.*:\1:'
Does anybody know of a way to write a makefile in a way
both "make"s will accept it? Is there some common syntax
both will accept? Or an if-then-else construct I could use?
\__ \ _/ -_) V / -_) ' \ Shell Script Programmers: visit