Cool. Thanks for the corrections. Ken
On Thu, May 12, 2005 at 04:34:35PM -0400, Paul D. Smith wrote: > %% Ken Smith <[EMAIL PROTECTED]> writes: > > ks> Without seeing your code, I can only assume that you are trying to > ks> do this in the command section of a rule. If that is the case, > ks> you'll need to use sed or something similar. > > Not true. > > ks> The GNU make functions will be processed when the files are read > ks> and not when the targets are run. > > No. Only parts of the makefile which are processed "immediately" are > processed when the files are read in. It has nothing to do with what > KIND of thing it is (variables, functions, etc.) and everything to do > with WHERE in the makefile it appears. > > The section "How make Reads a Makefile" in the manual explains which > parts of the makefile are expanded immediately, and which are deferred. > > The contents of the command scripts are always deferred. > > ks> my_root=root > > ks> file1.out: $(my_root)/folder1/file1 > ks> @echo "modified prerequisite=\"`echo $< | sed -e > 's/folder1\///'`\"" > > This is way overkill; a simple: > > file1.out: $(my_root)/folder1/file1 > @echo 'modified prerequisite="$(subst folder1/,,$<)"' > > will work fine. > > -- > ------------------------------------------------------------------------------- > Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at: > http://www.gnu.org http://make.paulandlesley.org > "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
