Say I have a directory tree and I'd like to include a Makefile from one of them, I define a variable:

define module_include
    $(if $(VPATH),VPATH := $(VPATH):$(CURDIR)/$(1),VPATH := $(CURDIR)/$(1))
    include $(CURDIR)/$(1)/module.mk
endef

which works, but I'd like to use it like this:

$(eval $(call module_include,subdir2)

after a previous module in subdir1 has been included and not as:

$(eval $(call module_include,subdir1/subdir2)

but if I modify CURDIR strange things happen - the modification for example does not take effect. I've tried:

define module_include
    CURDIR += /$(1)
    $(if $(VPATH),VPATH := $(VPATH):$(CURDIR),VPATH := $(CURDIR))
    include $(CURDIR)/module.mk
    CURDIR := $(notdir $(CURDIR))
endef


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

Reply via email to