X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fclam%2Frules.def;h=3cf8bf6ed824f64dd822308be9a4860e10be1da0;hb=3f864e27a81cb09ae37e0331604a350c9d48c080;hp=13279c2c5410ecaf65e2e875455f7ff0e0b4113e;hpb=6b5e7d0c7b8646858be7bf2979b1141178dfb8d5;p=feisty_meow.git diff --git a/scripts/clam/rules.def b/scripts/clam/rules.def index 13279c2c..3cf8bf6e 100644 --- a/scripts/clam/rules.def +++ b/scripts/clam/rules.def @@ -3,9 +3,9 @@ ############################################################################### # This file contains composite macros and rules for creating objects. -# This file should be included in the user's makefile after the variables +# This file should be included in the user makefile after the variables # have been initialized appropriately for the particular project being -# created. The user's own targets should be placed after the include +# created. The user targets should be placed after the include # directive that specifies this file. ############################################################################### @@ -19,18 +19,18 @@ ifneq "$(BUILD_AFTER)" "" LAST_TARGETS += $(BUILD_AFTER:%=%.make) endif -# Make the default action be an error stop if we can't find an appropriate rule. +# Make the default action be an error stop if we ca not find an appropriate rule. .DEFAULT: $(HIDER)echo $(HIDER)echo [$@] is missing files or has a makefile problem. $(HIDER)echo - $(HIDESH)$(CLAM_DIR)/exit_make.sh + $(HIDESH)$(CLAM_SCRIPTS)/exit_make.sh # This rule halts make for some supposedly devastating reason. More # information should be printed out by the cause of the halt. %.halt: @echo CLAM execution halted, the cause being: $@ - $(HIDESH)$(CLAM_DIR)/exit_make.sh + $(HIDESH)$(CLAM_SCRIPTS)/exit_make.sh # Provides a time-stamp in the make log. show_date.%: @@ -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 "($@ skipping directory $*)"; \ 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 @@ -87,39 +88,51 @@ endif # runs the programs specified in the RUN_TARGETS variable. run_targets: - $(HIDESH)"$(CLAM_DIR)/target_runner.sh" + $(HIDESH)"$(CLAM_SCRIPTS)/target_runner.sh" # "make_subdirs" travels down each subdirectory and builds using make. make_subdirs: - $(HIDESH)$(CLAM_DIR)/make_subdirs.sh + $(HIDESH)$(CLAM_SCRIPTS)/make_subdirs.sh # "clean" is a default target that removes object files, libs, executable # 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: set_cleaner_variable $(OTHER_CLEANS) scratch_other_cleans clean_subdirs ready_to_clean - # no code here. +clean: establish_cleanup_variable $(OTHER_CLEANS) scratch_other_cleans clean_subdirs add_to_cleanups_variable ready_to_clean + @# no code here. -set_cleaner_variable: +establish_cleanup_variable: $(eval CLEAN := true) 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 different versions of +# the file suffixes so we can clean all versions of the targets. +add_to_cleanups_variable: $(SUPPLEMENTAL_CLEANUP_TARGETS) + $(eval CLEANUPS = $(ACTUAL_TARGETS) $(CLEANUPS) ) +# $(eval CLEANUPS = $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.exe=%) $(ACTUAL_TARGETS:%.dll=%.so) $(ACTUAL_TARGETS:%.so=%.dll) $(CLEANUPS) ) +# echo "new CLEANUPS variable: $(CLEANUPS)" + +# main cleaning task. ready_to_clean: - @echo Whacking [$(CLEANUPS)] +ifneq "$(CLEANUPS)" "" + @echo Whacking [$(notdir $(CLEANUPS))] +endif $(HIDESH) -c '\ -echo the other cleans were: $(OTHER_CLEANS); \ -echo the cleanup removal list is: $(CLEANUPS); \ if [ ! -z "$(CLEANUPS)" ]; then \ for spork19 in $(CLEANUPS) nonexistentishfileforlist; do \ rm -rf "$$spork19"; \ done \ fi' +############################################################################ + # "clean_subdirs" travels down each subdirectory and cleans using make. clean_subdirs: - $(HIDESH)$(CLAM_DIR)/clean_subdirs.sh + $(HIDESH)$(CLAM_SCRIPTS)/clean_subdirs.sh # "rm_links" removes the files in the current directory that are links # to other files. this is only useful in a unix environment.