help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding which makefile is including another


From: Markus Mauhart
Subject: Re: Finding which makefile is including another
Date: Tue, 10 Jun 2003 21:05:11 +0200

If you have all makefiles under your control, then probably the following
machinery can help you:

I use/include this one in the master-file that includes all other files:

#***************************************
# __FILE__
#
var_from_string = $1

define __FILE__prefix
tmp := $$(word $$(words $$(MAKEFILE_LIST)),$$(MAKEFILE_LIST))
$$(call var_from_string,$$(tmp))__FILE__old := $$(__FILE__)
__FILE__ := $$(tmp)
endef

define __FILE__suffix
__FILE__ := $($(call var_from_string,$(__FILE__))__FILE__old)
endef
#
# __FILE__
#***************************************

$(eval $(__FILE__prefix))


Then each other file that wants to know/use its own name looks like ...
#-----------------------------------
$(eval $(__FILE__prefix))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]