In GNU Make 4.0 when I ask for --no-builtin-variables but later assign
to a builtin-variable, then subsequent expansions of that variable produce
a null string instead of what I assigned. This is different from the behavior
of GNU Make 3.82, where the expansion produces the value that I assigned.
It seems to me that the explicit assignment should be honored
because it occurs after the request for --no-builtin-variables.
The workaround in GNU Make 4.0 is to use a different name
because it looks like --no-builtin-variables permanently disables
those names. If the behavior of GNU Make 4.0 is intended
then it would be nice to complain for any attempted assignment
that always will be ignored.
-----example makefile foo.mk
# -R: --no-builtin-variables. [Also implies -r: --no-builtin-rules.]
MAKEFLAGS += -R
# Attempt to assign to a built-in variable
ifeq ($(CC),)
CC = gcc
endif
foo: foo.o
$(CC) -o $@ $<
%.o : %.c
$(CC) -o $@ -c $<
----- end foo.mk
$ rm -f foo foo.o
$ touch foo.c
$ make -n -f foo.mk
o foo.o -c foo.c
o foo foo.o
$ ### Notice no "gcc" in expansion of "$(CC)" in previous 2 lines
$ make --version
GNU Make 4.0
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2013 Free Software Foundation, Inc.
[[snip]]
--
_______________________________________________
Bug-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-make