From: Chris Koeritz Date: Mon, 3 Oct 2016 23:01:41 +0000 (-0400) Subject: slightly closer but cleanups are still wrong. X-Git-Tag: 2.140.90~391 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=46b407c692a357ac185d58208b0359a60355dc3a;p=feisty_meow.git slightly closer but cleanups are still wrong. --- diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index e0b72315..a6821bf4 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -398,15 +398,6 @@ ACTUAL_LAST_TARGETS = post_compilation $(LAST_TARGETS) ############################################################################ -ifneq "$(CLEAN)" "" -# Add the obligatory junk to be cleaned up. -set_cleanups_variable: - $(eval CLEANUPS += $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.exe=%) ) -# echo "new CLEANUPS variable: $(CLEANUPS)" -endif - -############################################################################ - # This section defines the rules used to generate various objects from their # source files. @@ -444,6 +435,17 @@ endif ############################################################################ +# trying to delay loading this as long as possible so the built in rule system for CLEANUPS can run with the right values. +# so far not working right! +#hmmm: fix this. + +# Adds the main CLAM system in to get some work done. This should be placed +# after the module's rules are defined and before the module's targets are +# defined. +include rules.def + +############################################################################ + # C++ source to object file translation. # if there is a special set of flags for this source file, we use them # instead of the default compiler flags. @@ -663,11 +665,6 @@ endif # Now the active part of the make process... -# Adds the main CLAM system in to get some work done. This should be placed -# after the module's rules are defined and before the module's targets are -# defined. -include rules.def - # make sure we really want to include the dependencies file. ifeq "$(TYPE)" "hierarchy" # no dependencies for a simple hierarchy builder. diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index 8643b27b..85619baf 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -117,10 +117,6 @@ endif # "UNDEFINITIONS" is a list of macros to undefine. #UNDEFINITIONS = -# Add an early target to set the cleanups variable based on the variables -# that have been filled in by the user makefile. -###no FIRST_TARGETS += set_cleanups_variable - # GLOBAL_PRODUCT_NAME is an important variable for tagging the entire code base # with some branding. It is provided as a macro definition to all source # files. The initial value for the macro should come from the build init @@ -292,9 +288,6 @@ export DEPS_FILE = $(OUTPUT_PATH)/$(PROJECT).deps # add the cleanup values we already know. CLEANUPS += $(OUTPUT_PATH) $(DEPS_FILE) -# schedule the cleanups to be updated when we know more info from the user. -OTHER_CLEANING_TASKS = set_cleanups_variable - # "GENDEPS" is a flag that causes dependencies to be generated into # statically built applications. export GENDEPS diff --git a/scripts/clam/rules.def b/scripts/clam/rules.def index 367f8f19..8d41bf95 100644 --- a/scripts/clam/rules.def +++ b/scripts/clam/rules.def @@ -98,7 +98,7 @@ make_subdirs: # files and such that were created by the project. it invokes the makefile # again with the CLEAN variable defined so that this can be passed down into # all subsequent makes. -clean: establish_cleanup_variable $(OTHER_CLEANS) scratch_other_cleans clean_subdirs ready_to_clean +clean: establish_cleanup_variable $(OTHER_CLEANS) scratch_other_cleans clean_subdirs add_to_cleanups_variable ready_to_clean @# no code here. establish_cleanup_variable: @@ -107,10 +107,18 @@ establish_cleanup_variable: scratch_other_cleans: $(eval OTHER_CLEANS := ) +# add late breaking items to the cleanup list. this is mainly the actual +# targets to build , since those are not specified until the user makefile +# is included. we take a liberty here and also add non ".exe" versions in +# case we are running on linux. +add_to_cleanups_variable: + echo going to add to cleanup variable now. + $(eval CLEANUPS = $(CLEANUPS) $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.exe=%) ) + echo "new CLEANUPS variable: $(CLEANUPS)" + # guard the main cleaning task with our variable # so we do not pull in subtargets when we do not want to. -ifneq "$(CLEAN)" "" -ready_to_clean: $(OTHER_CLEANING_TASKS) +ready_to_clean: @echo Whacking [$(CLEANUPS)] $(HIDESH) -c '\ if [ ! -z "$(CLEANUPS)" ]; then \ @@ -118,10 +126,8 @@ if [ ! -z "$(CLEANUPS)" ]; then \ rm -rf "$$spork19"; \ done \ fi' -else -ready_to_clean: - @# do nothing. -endif + +############################################################################ # "clean_subdirs" travels down each subdirectory and cleans using make. clean_subdirs: