[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Querying the name of the current makefile
From: |
Greg Chicares |
Subject: |
Querying the name of the current makefile |
Date: |
Mon, 03 Apr 2006 15:32:33 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
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'
- Querying the name of the current makefile,
Greg Chicares <=