############################################################################
-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.
############################################################################
+# 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.
# 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.
# "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
# 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
# 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:
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 \
rm -rf "$$spork19"; \
done \
fi'
-else
-ready_to_clean:
- @# do nothing.
-endif
+
+############################################################################
# "clean_subdirs" travels down each subdirectory and cleans using make.
clean_subdirs: