From 4be7627787c8ef59b9c2dac636d2665afbb9bf96 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Mon, 3 Oct 2016 20:02:46 -0400 Subject: [PATCH] fixed for cleaning up the .a files should be back in working shape now. lots of learning and pain involved. --- doc/makefile | 2 +- production/setup_src/bundle_example/makefile | 2 +- .../setup_src/whole_build_package/makefile | 2 +- scripts/clam/clean_subdirs.sh | 2 +- scripts/clam/cpp/rules.def | 15 +++++++++++++++ scripts/clam/cpp/variables.def | 2 ++ scripts/clam/make_subdirs.sh | 2 +- scripts/clam/rules.def | 17 ++++++++++------- 8 files changed, 32 insertions(+), 12 deletions(-) diff --git a/doc/makefile b/doc/makefile index 41fee0cd..88ed4167 100644 --- a/doc/makefile +++ b/doc/makefile @@ -7,7 +7,7 @@ include cpp/variables.def PROJECT = Source_Documentation TYPE = application FIRST_TARGETS += build_doxygen -CLEANUPS = html +CLEANUPS += html include cpp/rules.def diff --git a/production/setup_src/bundle_example/makefile b/production/setup_src/bundle_example/makefile index a1ca4a76..1ff75aea 100644 --- a/production/setup_src/bundle_example/makefile +++ b/production/setup_src/bundle_example/makefile @@ -3,7 +3,7 @@ include cpp/variables.def PROJECT = example_bundle TYPE = hierarchy FIRST_TARGETS += build_bundle -CLEANUPS = $(FEISTY_MEOW_APEX)/install/example_bundle$(EXE_END) +CLEANUPS += $(FEISTY_MEOW_APEX)/install/example_bundle$(EXE_END) # set the unix bin variable so the bundle finds the apps. export UNIX_BIN = /bin diff --git a/production/setup_src/whole_build_package/makefile b/production/setup_src/whole_build_package/makefile index 9a767d66..4d9c33f1 100644 --- a/production/setup_src/whole_build_package/makefile +++ b/production/setup_src/whole_build_package/makefile @@ -2,7 +2,7 @@ include cpp/variables.def PROJECT = Whole_Build_Pack FIRST_TARGETS += create_package -CLEANUPS = $(RUNTIME_DIR)/install/whole_build* +CLEANUPS += $(RUNTIME_DIR)/install/whole_build* TYPE = hierarchy export TARGET=/tmp/zz_wholebuild_$(USER) diff --git a/scripts/clam/clean_subdirs.sh b/scripts/clam/clean_subdirs.sh index 8eb4cdcf..45d2c1e1 100755 --- a/scripts/clam/clean_subdirs.sh +++ b/scripts/clam/clean_subdirs.sh @@ -11,7 +11,7 @@ function clean_subdirectories() for smoot87 in $(find . -mindepth 1 -maxdepth 1 -type d); do # make sure there's a makefile there. if [ -f "$smoot87/makefile" ]; then -#echo "inside barriers, with filename=$smoot87 and all conditions met." +#echo -e "\n\n[[inside barriers, with filename=$burlap51 and all conditions met]]\n\n" pushd "$smoot87" &>/dev/null make --silent -I "$CLAM_DIR" NOT_FIRST_MAKE=t clean popd &>/dev/null diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index eff3d6bf..64f2dde5 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -450,6 +450,21 @@ include rules.def ############################################################################ +# this adds in a customization for the cleanup variables, since the base +# clam code has no idea about a dynamic library directory. + +cpp_add_to_cleanups_variable: +# echo here is actual targets before hand $(ACTUAL_TARGETS) + $(eval CLEANUPS = $(ACTUAL_TARGETS:$(STATIC_LIBRARY_DIR)/%.library=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%.a) $(CLEANUPS) ) +# echo "IN CPP, new CLEANUPS variable: $(CLEANUPS)" + +#dynamic is taken care of in clam base still? +#DYNAMIC_LIBRARY_DIR +#hmmm: still should change there in the base and do it +# here instead. + +############################################################################ + # 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. diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index 85619baf..caf69cba 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -288,6 +288,8 @@ export DEPS_FILE = $(OUTPUT_PATH)/$(PROJECT).deps # add the cleanup values we already know. CLEANUPS += $(OUTPUT_PATH) $(DEPS_FILE) +SUPPLEMENTAL_CLEANUP_TARGETS = cpp_add_to_cleanups_variable + # "GENDEPS" is a flag that causes dependencies to be generated into # statically built applications. export GENDEPS diff --git a/scripts/clam/make_subdirs.sh b/scripts/clam/make_subdirs.sh index 1a88e52e..fcb8f8a8 100755 --- a/scripts/clam/make_subdirs.sh +++ b/scripts/clam/make_subdirs.sh @@ -11,7 +11,7 @@ function make_subdirectories() for burlap51 in $(find . -mindepth 1 -maxdepth 1 -type d); do # make sure there's a makefile there. if [ -f "$burlap51/makefile" ]; then -#echo "inside barriers, with filename=$burlap51 and all conditions met." +#echo -e "\n\n[[inside barriers, with filename=$burlap51 and all conditions met]]\n\n" pushd "$burlap51" &>/dev/null make --silent -I "$CLAM_DIR" NOT_FIRST_MAKE=t popd &>/dev/null diff --git a/scripts/clam/rules.def b/scripts/clam/rules.def index 182db898..b4074796 100644 --- a/scripts/clam/rules.def +++ b/scripts/clam/rules.def @@ -108,13 +108,16 @@ 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 with the actual targets as $(ACTUAL_TARGETS)" - $(eval CLEANUPS = $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.exe=%) $(CLEANUPS) ) - echo "new CLEANUPS variable: $(CLEANUPS)" +# targets to build, since those are not specified until the user makefile +# is included. we take a liberty here and also add different versions of +# the file suffixes so we can clean all versions of the targets. +add_to_cleanups_variable: $(SUPPLEMENTAL_CLEANUP_TARGETS) +# echo "going to add to cleanup variable now with the actual targets as $(ACTUAL_TARGETS)" + $(eval CLEANUPS = $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.exe=%) $(ACTUAL_TARGETS:%.dll=%.so) $(ACTUAL_TARGETS:%.so=%.dll) $(CLEANUPS) ) +# echo "new CLEANUPS variable: $(CLEANUPS)" +#hmmm: above is very code knowledgeable. +# we should have a working mechanism for doing a specialized +# type of cleanups addition, so we should rely on that instead of doing it above. # guard the main cleaning task with our variable # so we do not pull in subtargets when we do not want to. -- 2.34.1