I can't seem to get a rule in my Makefile to ever run... even if I change the rule to force make to re-enter the rule, or if I change the dependent files the rule depends on. Any ideas why the second rule is being ignored here?
#MAKEFILES = $(DIRS:%=$(ROOT)/%/Makefile)
#$(MAKEFILES):
# @echo -e $(COLOR_GREEN) Making framework library: $@ $(COLOR_DEFAULT)
# \make -f $@ build
# @echo -e $(COLOR_GREEN) Making framework library: $@ $(COLOR_DEFAULT)
# ar $(ARCHIVEROPTS) $@ $(OBJECTS)
# @echo -e $(COLOR_MAGENTA) Adding objects to $(ARCHIVE) $(COLOR_DEFAULT)
# ar $(ARCHIVEROPTS) $(ARCHIVE) $(OBJECTS)
$(ROOT)/libcommon/Makefile:
@echo -e $(COLOR_GREEN) Making library: $@ $(COLOR_DEFAULT)
\make -f $@ build
MAIN_CPP = $($(MAIN_LIBRARY):$(ROOT)/libmain/%/bld/main.cpp)
MAIN_OBJECT = $($(MAIN_CPP):%.cpp=%.o)
$(MAIN_LIBRARY): $(MAIN_OBJECT)
@echo -e $(COLOR_CYAN) Compiling main from library: $@ $(COLOR_DEFAULT)
ar $(ARCHIVEROPTS) $@ $(MAIN_OBJECT)
@echo -e $(COLOR_MAGENTA) Adding object to $(ARCHIVE) $(COLOR_DEFAULT)
ar $(ARCHIVEROPTS) $(ARCHIVE) $(MAIN_OBJECT)
%.o: %.cpp $(MAKE_CONFIGURATION)
@echo -e $(COLOR_BLUE) Compiling: $@ $(COLOR_DEFAULT)
g++ $(CPPOPTS) -frandom-seed="$(shell pwd)/$@" $(INCLUDE_DIRS:%=-I%) $< -c -o $@
BIN_DEPENDENCIES = Makefile \
$(INCLUDE_DIRS) \
$(LIBRARIES) \
$(MAIN_LIBRARY) \
$(OBJECTS)
$(BIN_TARGET): checkout_source $(ROOT)/libcommon/Makefile.portal $(MAIN_LIBRARY) $(OBJECTS)
@echo -e $(_COLOR_CYAN)Linking: $@ $(_COLOR_DEFAULT)
@echo -e $(_COLOR_CYAN)USING ARCHIVE $(_COLOR_DEFAULT)
g++ $(LINKOPTS) -Wl \
\
$(INCLUDE_DIRS:%=-I%) \
\
$(ARCHIVE) \
\
$(BOOST_LIBRARIES:%=-l%) -o $(BIN_TARGET)
dumpvars:
@echo G_CPPS $(G_CPPS)
@echo G_OBJECTS $(G_OBJECTS)
@echo INCLUDE_DIRS $(INCLUDE_DIRS)
@echo MAKEFILES $(MAKEFILES)
@echo MAIN_OBJECT $(MAIN_OBJECT)
The rule in bold is the rule getting skipped for some reason. I know FRAMEWORK_MAKEFILES is populated with all the proper values when I run the dumpvars rule. I commented out that rule and replaced it an exact specific rule for the makefile in a given directory rather than doing each and every rule, and it still skips the rule. I know the rule is being skipped due to the absence of the echo command.