Make Include Question

view full story

http://www.linuxforums.org – I'm adding some code generation to an existing build system. The log_codegen.mk file just runs a perl script that generates a few files. It's a pretty simple file and the only reason it is in it's own file is that this file gets called from multiple other makefiles (easier maintenance). log_codegen.mk Code: CODEGEN_SRC_DIR = $(ROOTDIR)/ne_codegen/scripts/logging_codegen #These aren't really needed, but at least this serves as a pointer to what files are #being generated, without having to dig into the perl script. #FAC_ALLOWED = $(ROOTDIR)/ne_sys/syslog50/CssLog_CfgMgr/CssLog_CfgMgr_FacAllowed.h #SUP_FAC_LISTS = $(ROOTDIR)/ne_sys/syslog50/CssLog_Platform_SupFacLists.cpp #Not sure that much else is needed. #genCssLogFiles.pl generates the two files and puts them where they are needed. #The PHONY target is always out of date, so the files will always get regenerated. .PHONY: generate generate:     @echo "Running Logging Codegen - perl (CODEGEN_SRC_DIR)/genCssLogFiles.pl"     perl $(CODEGEN_SRC_DIR)/genCssLogFiles.pl The problem is, if I use the include directive (as seen in Makefile below) the perl script runs fine, but once it's done the make quits (not via an error - it behaves as if everything is completed). I can put the include inside a target (like COMMON_DIR_TARGS) and the code gen'r will run correctly and then make will truck on as expected. I suspect that log_codegen.mk is perhaps hijacking the dependencies, fooling make into thinking it's done. What I don't get is why, since there are other include directives deeper in the build system that follow similar paradigms to what I'm doing here that don't hijack anything and fool the system into quitting too early. Any ideas? Makefile Code: ROOTDIR = ../.. CODEGEN_SRC_DIR = $(ROOTDIR)/ne_codegen/scripts/logging_codegen include    $(ROOTDIR)/ne_tools/include/tools.mk TM_ADD_COMPAT_VERSION_TO_SIG=yes PLATFORM := *** # Define the files we're going to turn into the contents of the .tar file COMPRESSABLE_FILES :=  *** # None of these for the RNC... NON_COMPRESSABLE_FILES := .PHONY: all PLATFORM_DIR_TARGS tar sf-local sc-local bio-local scboot biosfboot .NOTPARALLEL: PLATFORM_DIR_TARGS COMMON_DIR_TARGS sc-local bio-local sf-local scboot biosfboot include    $(ROOTDIR)/ne_tools/include/log_codegen.mk#The problem child all: PLATFORM_DIR_TARGS     $(MAKE) tar # We want to tell the components to restrict their builds to the local # targets... We will build the common targets separately COMMON_DIR_TARGS:     #include $(ROOTDIR)/ne_tools/include/log_codegen.mk#Works fine if called from in here     $(CD) ..$(DS)ppc75x$(DS)common && $(MAKE)     $(CD) ..$(DS)ppc75x$(DS)sc && $(MAKE)     $(CD) ..$(DS)ppc75x$(DS)sf && $(MAKE)     $(CD) ..$(DS)ppc75x$(DS)bio && $(MAKE)     $(CD) sc && $(MAKE) TEAMF1 #generate dependency goes here PLATFORM_DIR_TARGS: COMMON_DIR_TARGS     $(MAKE) local local: <more dependencies/> (HowTos)