help-make
[Top][All Lists]
Advanced

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

emuating recursive make


From: John Doe
Subject: emuating recursive make
Date: Fri, 13 Apr 2007 18:10:28 +0200
User-agent: Thunderbird 1.5.0.10 (X11/20070305)

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




reply via email to

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