Hi,
I have this makefile where the target specific variable TOP_FILE is in
effect for an unrelated target:
TOP_FILE=file.src
TOP_FILE_TARGET=file.tgt
# Pattern rule target specific variable TOP_FILE
# should influence this rule and its prerequisites only
./compile/% %.tgt: TOP_FILE=other.src
./compile/% %.tgt:
@echo Pattern rule for most .tgt files
all: $(TOP_FILE_TARGET)
# TOP_FILE variable is influenced by the pattern rule target specific
# target above, but this rule is not a prerequisite of the pattern rule
$(TOP_FILE_TARGET): $(TOP_FILE)
@echo Building $(TOP_FILE_TARGET)
@echo src2tgt $(TOP_FILE) -o $(TOP_FILE_TARGET)
@exit 1
To run this:
touch file.src
make
You should get:
Building file.tgt
src2tgt other.src -o file.tgt
make: *** [file.tgt] Error 1
The target specific variable $(TOP_FILE) which is supposed to be in effect
for the target %.tgt and its prerequisites is also in effect for the
$(TOP_FILE_TARGET) target. I was expecting the second line to be:
src2tgt file.src -o file.tgt
Is this normal? Is this a bug?
Thanks,
Martin
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make