help-make
[Top][All Lists]
Advanced

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

limitations of 'include' directive?


From: gk
Subject: limitations of 'include' directive?
Date: Fri, 25 Oct 2002 01:41:47 -0700

I am trying to include a makefile which contains the names of other makefiles to include. If the first makefile is out of date, it is rebuilt using a pattern rule but after that point no more files can be included.

It appears that make only gives you one shot when using auto-generated included makefiles:
all included makefiles must be named in the top level makefile.

Is there any way to do a recursive 'include' after rebuilding included makefiles?
(really trying to avoid sub-make...)

Thanks,
Greg Keraunen

--- Makefile exerpt: $(XMLMAKE_PROJECT_DIR)/xmProject.mk

# XMLMAKE_PROJECT_MAKEFILES includes each xmMakefile as well as
# dependency makefiles for each output file, like %.xmo.mk
-include $(XMLMAKE_PROJECT_MAKEFILES)

# no dependencies for this makefile
$(XMLMAKE_PROJECT_DIR)/xmProject.mk : ;

makefiles : $(XMLMAKE_PROJECT_MAKEFILES)

# if any files are added or deleted from a directory, the modification date changes # We need to remake xmMakefile to make sure it knows about all the source files and subdirectories
%/xmMakefile : %
        @echo "rule: %/xmMakefile; (target=$@)"
        @echo "# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT." > $@
        @SUBDIRS=$$(xmsubdirs $<);\
        echo "# add subdirectories and their xmMakefiles"  >> $@;\
        for subdir in $$SUBDIRS; do\
                echo subdir=$$subdir;\
echo 'XMLMAKE_PROJECT_DIRS:=$$(XMLMAKE_PROJECT_DIRS)' "$</$$subdir/xmMakefile" >> $@;\ echo 'XMLMAKE_PROJECT_MAKEFILES:=$$(XMLMAKE_PROJECT_MAKEFILES)' "$</$$subdir/xmMakefile" >> $@;\
        done;\
        echo "# add targets in this directory for the default rule"   >> $@;\
echo 'XMLMAKE_PROJECT_TARGETS:=$$(XMLMAKE_PROJECT_TARGETS)' $(patsubst $</%.xms,$</%.xmo,$(wildcard $</*.xms)) >> $@;\ echo $@: rebuilt;




reply via email to

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