I discovered an unexpected interaction between environment variables and the override directive earlier this week (I tried gmake-3.81 and gmake-3.82 on NetBSD and Linux).
Normally, when a variable is set on the command line, it is exported to the environment: 'Except by explicit request, `make' exports a variable only if it is either defined in the environment initially or set on the command line,...' So for the following Makefile: CFLAGS = -O2 all: ; @echo $$CFLAGS There is no output if gmake is invoked without arguments, and "-O2 -g" if gmake is invoked as "gmake CFLAGS='-O2 -g'". But if the Makefile is changed to use the override directive, like this: override CFLAGS += -g all: ; @echo $$CFLAGS CFLAGS is not exported to the environment when gmake is invoked as "gmake CFLAGS=-O2". In my use case, it was easy enough to change it to the equivalent to export override CFLAGS += -g all: ; @echo $$CFLAGS Perhaps it's implied, but I thought I'd mention it, as neither the 'override directive' nor the 'communicating variables to a sub-make' sections explicitly say that the variables specified on the command line will not be exported to the environment if used with the over- ride directive. --jtc -- J.T. Conklin _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make