fix major hoseage in building
[feisty_meow.git] / scripts / clam / rules.def
index 4d0be0e8712b3933df947eb2cdd78fb555251c77..367f8f190e9d63d2cc0c8d4dbe9180571c6af176 100644 (file)
@@ -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
@@ -97,16 +98,19 @@ 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: set_cleaner_variable $(OTHER_CLEANS) scratch_other_cleans clean_subdirs  ready_to_clean
+clean: establish_cleanup_variable $(OTHER_CLEANS) scratch_other_cleans clean_subdirs  ready_to_clean
        @# no code here.
 
-set_cleaner_variable:
+establish_cleanup_variable:
        $(eval CLEAN := true)
 
 scratch_other_cleans:
        $(eval OTHER_CLEANS := )
 
-ready_to_clean:
+# 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)
        @echo Whacking [$(CLEANUPS)]
        $(HIDESH) -c '\
 if [ ! -z "$(CLEANUPS)" ]; then \
@@ -114,6 +118,10 @@ 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: