help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

secondexpansion interference


From: Martin d'Anjou
Subject: secondexpansion interference
Date: Fri, 25 Apr 2014 16:08:05 -0400

Hi,

I concocted a contrived example where the presence of a prerequisite alters
the execution of GNU Make depending on its presence. I also use second
expansion. This is the makefile:

.SECONDEXPANSION:
file_x  := f.q
build_x := touch

%.tcl: $(interference) $$(file_$$*)
        $(build_$*) \
  $@

%.q: %.tcl
        touch $@

To run, first touch a few files so they exist:
$ touch f.q file.txt

Next, run make (this works):
$ make x.tcl
touch \
  x.tcl

Ok, clean up:
$ rm x.tcl

Now interfere with the process:
$ make x.tcl interference=file.txt
make x.tcl
\
  f.tcl
make: f.tcl: Command not found
make: *** [f.tcl] Error 127

This problem feels familiar. Can someone explain this behaviour?

Thanks,
Martin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]