I used MAKEFILE_LIST variable in the Makefile, executed on Linux 9. But it
seems it is always empty.
For instance, in the following simple makefile, it always echoes nothing. I
should be at least current Makefile.
all:
@echo $(MAKEFILE_LIST)
I also tried the following example from gnu website, it always complain "the
first argument to 'word' function must be greater than 0." The cause is
still empty MAKEFILE_LIST.
Can somebody advice me on this?
Thanks!
name1 := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
include inc.mk
name2 := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
all:
@echo name1 = $(name1)
@echo name2 = $(name2)
then you would expect to see this output:
name1 = Makefile
name2 = inc.mk
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make