Noel Yap <[EMAIL PROTECTED]> writes: > define _include-makefile > __FILE__.pre-$(1) := $(__FILE__) > __FILE__ := $(1) > include $(1) > __FILE__ := $(__FILE__.pre-$(1)) > endef > > include-makefile = $(eval $(call _include-makefile,$(1))) > > Then one can do: > # GNUmakefile > $(call include-makefile,make/GNUmine.mk) > > ... > > Does anyone see any problems with the above?
Yep, if you include the same file more than once recursively then the '__FILE__.pre-$(1)'-based approach won't be able to restore previous path. I've been using basically the same technique (plus fix for the problem mentioned above) for a while now. It works pretty well. Also with this approach you get the ability to create makefile-local variables. I you are interested I can email you my implementation. hth, -boris -- Boris Kolpackov [EMAIL PROTECTED] http://kolpackov.net 3072R/AE084F1D - F608 942F 312E D82E 5B84 0407 C880 290B AE08 4F1D _______________________________________________ Help-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make
