MAKEFLAGS += rR still doesn't work as expected: $ cat Makefile
MAKEFLAGS += rR CC ?= my_gcc debug: @echo 'origin of CC:' $(origin CC) @echo 'value of CC: ' $(CC) %.o: %.c $(CC) $< -o $@ $ touch test.c $ make test.o test.c -o test.o make: test.c: Command not found make: *** [Makefile:11: test.o] Error 127 $ make debug origin of CC: undefined value of CC: $ make -rR debug origin of CC: file value of CC: my_gcc $ make -rR test.o my_gcc test.c -o test.o make: my_gcc: Command not found make: *** [Makefile:11: test.o] Error 127 $ So although injecting rR into MAKEFLAGS does have an effect (CC etc. end up undefined), it doesn't seem to happen in time to have the expected results on e.g. subsequent conditional assignment. In the above example, at the time the conditional assignment happens, Make still considers CC to have origin default, as can be seen by adding a line like: $(info origin of CC: $(origin CC)) immediately above the conditional assignment line. If assignment into MAKEFLAGS is going to be supported at all, it should have exactly the effect that the corresponding command line options have. In this case, that means CC etc. should be undefined (as with the undefine directive) from the point rR is injected, not just empty with origin default. So if when MAKEFLAGS += rR happens and CC has origin default, it should be undefined. It it's origin is file or command line or something it should be left alone. Britton _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make