From 090ac080acb0cc4f3fd4c9332b08d2dd5fb77394 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Mon, 3 Oct 2016 18:18:43 -0400 Subject: [PATCH] wow, might actually be right now for the subdir cleaning with the right targets. hoping so. --- doc/makefile | 2 +- nucleus/makefile | 2 +- production/setup_src/bundle_example/makefile | 2 +- .../setup_src/whole_build_package/makefile | 2 +- scripts/clam/clam_parms.ini | 6 +-- scripts/clam/clean_subdirs.sh | 6 +-- scripts/clam/cpp/rules.def | 8 ++++ scripts/clam/cpp/variables.def | 46 +++++++++++-------- scripts/clam/make_subdirs.sh | 6 +-- scripts/clam/rules.def | 9 +++- scripts/clam/variables.def | 12 ++--- 11 files changed, 57 insertions(+), 44 deletions(-) diff --git a/doc/makefile b/doc/makefile index ae493d94..41fee0cd 100644 --- a/doc/makefile +++ b/doc/makefile @@ -6,7 +6,7 @@ include cpp/variables.def PROJECT = Source_Documentation TYPE = application -FIRST_TARGETS = build_doxygen +FIRST_TARGETS += build_doxygen CLEANUPS = html include cpp/rules.def diff --git a/nucleus/makefile b/nucleus/makefile index 1ae91746..4f931027 100644 --- a/nucleus/makefile +++ b/nucleus/makefile @@ -18,7 +18,7 @@ include $(CLAM_DIR)/cpp/variables.def PROJECT = feisty_meow_nucleus TYPE = hierarchy -FIRST_TARGETS = do_make +FIRST_TARGETS += do_make BUILD_AFTER = library applications tools include $(CLAM_DIR)/cpp/rules.def diff --git a/production/setup_src/bundle_example/makefile b/production/setup_src/bundle_example/makefile index 0c30a4fd..a1ca4a76 100644 --- a/production/setup_src/bundle_example/makefile +++ b/production/setup_src/bundle_example/makefile @@ -2,7 +2,7 @@ include cpp/variables.def PROJECT = example_bundle TYPE = hierarchy -FIRST_TARGETS = build_bundle +FIRST_TARGETS += build_bundle 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 b49a0de5..9a767d66 100644 --- a/production/setup_src/whole_build_package/makefile +++ b/production/setup_src/whole_build_package/makefile @@ -1,7 +1,7 @@ include cpp/variables.def PROJECT = Whole_Build_Pack -FIRST_TARGETS = create_package +FIRST_TARGETS += create_package CLEANUPS = $(RUNTIME_DIR)/install/whole_build* TYPE = hierarchy export TARGET=/tmp/zz_wholebuild_$(USER) diff --git a/scripts/clam/clam_parms.ini b/scripts/clam/clam_parms.ini index 79fe1a97..86e68dd2 100644 --- a/scripts/clam/clam_parms.ini +++ b/scripts/clam/clam_parms.ini @@ -1,7 +1,7 @@ #\ [version] -major=4 -minor=20 -revision=1008 +major=5 +minor=1 +revision=1 build=0 diff --git a/scripts/clam/clean_subdirs.sh b/scripts/clam/clean_subdirs.sh index 00ba783c..8eb4cdcf 100755 --- a/scripts/clam/clean_subdirs.sh +++ b/scripts/clam/clean_subdirs.sh @@ -12,11 +12,11 @@ function clean_subdirectories() # make sure there's a makefile there. if [ -f "$smoot87/makefile" ]; then #echo "inside barriers, with filename=$smoot87 and all conditions met." - pushd "$smoot87" + pushd "$smoot87" &>/dev/null make --silent -I "$CLAM_DIR" NOT_FIRST_MAKE=t clean - popd + popd &>/dev/null else - echo "Skipping makefile-less directory $smoot87..." + echo "(skipping directory $smoot87)" fi done } diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index 73efdfd4..ba51dabb 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -398,6 +398,14 @@ ACTUAL_LAST_TARGETS = post_compilation $(LAST_TARGETS) ############################################################################ +# Add the obligatory junk to be cleaned up. +set_cleanups_variable: + echo hey we are in the set cleanups variable and pwd is: $(shell pwd) + $(eval CLEANUPS += $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.exe=%) ) + echo "yoyo, cleanups variable is now: $(CLEANUPS)" + +############################################################################ + # This section defines the rules used to generate various objects from their # source files. diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index 222a9d6d..6bbd346a 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -21,7 +21,7 @@ include variables.def ############################################################################### -#no # set the repository directory if it's still set to the base version. +#no # set the repository directory if it is still set to the base version. #ifeq "$(FEISTY_MEOW_APEX)" "" # ifeq "$(OP_SYSTEM)" "UNIX" # export FEISTY_MEOW_APEX = $(HOME)/hoople @@ -91,7 +91,7 @@ export COMPILER_VERSION # "TYPE" is the kind of product being generated by this project. this is # used to decide where to put the final products of compilation. this is a -# variable in the user's makefile. +# variable in the user makefile. # Valid Types: # TYPE = library (outputs are static or dynamic libraries) # TYPE = application (outputs are main-line executables) @@ -117,6 +117,10 @@ 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. +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 @@ -141,7 +145,7 @@ export TEST_MAKEFILE = # be passed on the command line to a make. if they are intended to be used # from inside a makefile, then they must appear before this file is included. -# "REBUILD" causes a rebuild of all source files if it's true. +# "REBUILD" causes a rebuild of all source files if it is true. export REBUILD # "DEBUG" is used to specify a debugging build. the default is for this to @@ -179,7 +183,7 @@ FLAG_FILES += $(BUILD_LIST_FILE) $(BUILD_WHACK_FILE) ############################################################################### # This section implements the HOOPLE directory scheme. If your scheme differs, -# then you'll want to modify these appropriately. +# then you will want to modify these appropriately. # "THIRD_PARTY_DIR" is the root of our support libraries. export THIRD_PARTY_DIR @@ -210,7 +214,7 @@ export BASE_OUTPUT_PATH = $(OUTPUT_ROOT)/$(CPU_BUILD_DIR) # special case when doing arm-linux builds ifeq "$(COMPILER)" "GNU_ARM_LINUX" export TARGETS_DIR = $(FEISTY_MEOW_APEX)/$(CPU_BUILD_DIR) - # special output directory for firmware doesn't include CPU name because + # special output directory for firmware does not include CPU name because # the repository already include the CPU name BASE_OUTPUT_PATH = $(OUTPUT_ROOT) endif @@ -261,7 +265,7 @@ LOCAL_HEADERS = $(THIRD_PARTY_DIR) HOOPLE_LIBRARIES = # "EXTRA_COPIES" is a list of files that need to be among the files copied -# to a project's output folder. +# to a project output folder. export EXTRA_COPIES # "EXTRA_VERSIONS" is a list of version files to synchronize with the main @@ -276,7 +280,7 @@ export EXTRA_VERSIONS export DEPS_FILE = $(OUTPUT_PATH)/$(PROJECT).deps # "NO_DEPS" is an exclusion flag. if it is defined, then no auto-dependency -# files will be generated. this is useful if you're missing makedep or trying +# files will be generated. this is useful if you are missing makedep or trying # to compile it... #NO_DEPS = t @@ -285,9 +289,11 @@ export DEPS_FILE = $(OUTPUT_PATH)/$(PROJECT).deps # such files. this is needed when rebuilding version_stamper. #OMIT_VERSIONS = t -# Add the obligatory junk to be cleaned up. Individual compiler sections -# should customize this by adding their object output directories. -CLEANUPS += $(ACTUAL_TARGETS) $(OUTPUT_PATH) $(DEPS_FILE) +# 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. @@ -358,7 +364,7 @@ LIBS_USED = # included (although they should be listed in a different form in LIBS_USED). # Remember that the unix loader looks for functions in libraries in a bizarre # way: ld searches for a function only when it has already been asked for it. -# This means that it doesn't remember what functions it has already been +# This means that it does not remember what functions it has already been # provided with in the libraries and object files, and it will fail if those # functions are only asked for after they have already been encountered. #LOAD_FLAG_PREFIX = @@ -436,7 +442,7 @@ endif # # "COMPILER_ROOT_DIR" is the top-level for the C++ compiler location. export COMPILER_ROOT_DIR -# "COMPILER_HEADER_DIR" is where the compiler's headers are. +# "COMPILER_HEADER_DIR" is where the compiler headers are. export COMPILER_HEADER_DIR # "COMPILER_LIBRARY_DIR" is where archived libraries are. # "CC" is the name of the C++ compiler to be used. @@ -533,10 +539,10 @@ ifeq "$(COMPILER)" "GNU_LINUX" ###COMPILER_FLAGS += -pg ###LOAD_FLAG_PREFIX += -pg -####trying out profiling: doesn't work so well yet. generates gmon.out files -#### in pretty random places. the parameters to the linker don't even -#### mention this flag, and the compiler flags don't seem to provide an -#### option for where the file goes. so, it's on hold. +####trying out profiling: does not work so well yet. generates gmon.out files +#### in pretty random places. the parameters to the linker do not even +#### mention this flag, and the compiler flags do not seem to provide an +#### option for where the file goes. so, it is on hold. endif @@ -638,7 +644,7 @@ ifeq "$(COMPILER)" "VISUAL_CPP" TRIPART_VERSION = CLEANUPS += $(PDB_DIR)/$(PROJECT)_bookkeeping.pdb -#hmmm: import libs for dynamic libraries on ms-win32 don't currently get +#hmmm: import libs for dynamic libraries on ms-win32 do not currently get # cleaned up nicely. # ensure that any setting for this is seen by sub-shells. @@ -793,7 +799,7 @@ ifeq "$(COMPILER)" "VISUAL_CPP" # -ML signifies uni-threaded executable (MLd means debug). # -MT indicates multi-threaded executable (MTd means debug) # -O is for optimization (1 small code, 2 fast code, d disabled). - # don't use 1 or 2 though; they both include "global optimization", + # do not use 1 or 2 though; they both include "global optimization", # which seems plagued with problems. the specific optimizations are: # -Oa assume no aliasing # -Obn inline function expansion, where n is 1 (enable) or 0 (disable) @@ -865,7 +871,7 @@ ifeq "$(COMPILER)" "VISUAL_CPP" # add the common linker flags. the debugging flag is added because we # want to be able to debug into release code, but since the pdb files - # are separate, we're not exposing ourselves when we don't include them. + # are separate, we are not exposing ourselves when we do not include them. LOAD_FLAG_PREFIX += $(PROFILER_FLAG) -debug -opt:ref -opt:icf #-warn:3 @@ -904,7 +910,7 @@ ifeq "$(COMPILER)" "VISUAL_CPP" ifneq "$(STRICT_WARNINGS)" "" COMPILER_FLAGS += -WX -#would like to add W4 but that triggers warnings in ms's own headers. +#would like to add W4 but that triggers warnings in microsoft headers. endif endif diff --git a/scripts/clam/make_subdirs.sh b/scripts/clam/make_subdirs.sh index ac950559..1a88e52e 100755 --- a/scripts/clam/make_subdirs.sh +++ b/scripts/clam/make_subdirs.sh @@ -12,11 +12,11 @@ function make_subdirectories() # make sure there's a makefile there. if [ -f "$burlap51/makefile" ]; then #echo "inside barriers, with filename=$burlap51 and all conditions met." - pushd "$burlap51" + pushd "$burlap51" &>/dev/null make --silent -I "$CLAM_DIR" NOT_FIRST_MAKE=t - popd + popd &>/dev/null else - echo "Skipping makefile-less directory $burlap51..." + echo "(skipping directory $burlap51)" fi done } diff --git a/scripts/clam/rules.def b/scripts/clam/rules.def index 4d0be0e8..032dd6d3 100644 --- a/scripts/clam/rules.def +++ b/scripts/clam/rules.def @@ -45,11 +45,12 @@ if [ -d $* ]; then \ if [ -f "$*/$(MAKEFILE_NAME)" ]; then \ $(MAKE) --silent -f "$(MAKEFILE_NAME)" NOT_FIRST_MAKE=t -C "$*"; \ else \ - echo Skipping makefile-less directory [$*]; \ + echo "Asked to build directory [$*] but there was no makefile."; \ fi \ else \ echo Skipping missing directory [$*]; \ fi' +#hmmm: maybe convert above to a script also. # always run the exes listed in RUN_TARGETS. .PHONY: run_targets @@ -106,8 +107,12 @@ set_cleaner_variable: scratch_other_cleans: $(eval OTHER_CLEANS := ) -ready_to_clean: +ready_to_clean: $(OTHER_CLEANING_TASKS) + echo hey the other clean should have happened above. @echo Whacking [$(CLEANUPS)] +# @echo could also be cleaning the first and last targets... +# @echo FIRST_TARGETS=$(FIRST_TARGETS) +# @echo LAST_TARGETS=$(LAST_TARGETS) $(HIDESH) -c '\ if [ ! -z "$(CLEANUPS)" ]; then \ for spork19 in $(CLEANUPS) nonexistentishfileforlist; do \ diff --git a/scripts/clam/variables.def b/scripts/clam/variables.def index 6acd2056..a9d1f724 100644 --- a/scripts/clam/variables.def +++ b/scripts/clam/variables.def @@ -188,18 +188,12 @@ include $(PARAMETER_FILE) ############################################################################ # "CLEAN" is a powerful flag that affects what clam does. if the flag is -# non-empty, then nothing will be built and every generated file that is -# known about will be deleted. it is intended as exported, since then sub- -# shells know that they are cleaning and we do not have to pass them a -# target. -#hmmm: (although we do?) +# non-empty, then nothing new will be built. export CLEAN # "CLEANUPS" are things to be removed by the "make clean" command. -undefine CLEANUPS +#CLEANUPS = # OTHER_CLEANS are targets to execute before performing the main clean up. -# we intentionally reset this here to avoid a polluted variable getting -# to us from a previous make. -undefine OTHER_CLEANS +#OTHER_CLEANS = # sets the temporary directory. export CLAM_TMP -- 2.34.1