Is there any way to determine the name of the current makefile?
'--file=what_I_want_to_know' doesn't appear in $(MAKEFLAGS).

## flags.make begins ##
this_makefile = flags.make

.PHONY: foo
foo:
        # Motivation: set some environment variables here,
        # and then invoke ourself.
        @echo "MAKEFLAGS is '$(MAKEFLAGS)'"
        $(MAKE) --no-print-directory --file=$(this_makefile) bar

.PHONY: bar
bar:
        @echo "MAKEFLAGS is '$(MAKEFLAGS)'"
## flags.make ends ##

Output:

  $make --file=flags.make foo
  MAKEFLAGS is ''
  C:/usr/bin/make.EXE --no-print-directory --file=flags.make bar
  MAKEFLAGS is ' --no-print-directory'


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to