may have fixed annoying make clean bugs
[feisty_meow.git] / scripts / clam / rules.def
index e9f91b155d5aa7ee70d4107ed9a323a480b8a0d4..a526fb1f392a53c82c768a1ab43dab852f6d93a6 100644 (file)
@@ -110,10 +110,13 @@ exit 0'
 # 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: 
-       $(HIDER)$(MAKE) --silent CLEAN=t ready_to_clean
+clean: set_cleaner_variable clean_subdirs $(OTHER_CLEANS) ready_to_clean
+       # no code here.
 
-ready_to_clean: $(OTHER_CLEANS) clean_subdirs
+set_cleaner_variable:
+       $(eval CLEAN := true)
+
+ready_to_clean:
        @echo Whacking [$(CLEANUPS)]
        $(HIDESH) -c '\
 echo the other cleans were: $(OTHER_CLEANS); \
@@ -127,9 +130,12 @@ fi'
 # "clean_subdirs" travels down each subdirectory and cleans using make.
 clean_subdirs:
        $(HIDESH) -c '\
-for i in *; do \
-  if [ -d "$$i" ]; then \
-    if [ -f "$$i/$(MAKEFILE_NAME)" -a ! "$$i" -ef `pwd` ]; then \
+for smoot87 in *; do \
+  if [ -d "$$smoot87" ]; then \
+echo "got inside first check of it being dir: $$smoot87"; \
+    if [ -f "$$smoot87/$(MAKEFILE_NAME)" -a ! "$$smoot87" -ef `pwd` ]; then \
+echo "got inside barriers, with filename=$$smoot87 and all conditions met."; \
+echo "the interesting one was: [$(test ! "$$smoot87" -ef `pwd` )]"; \
       (cd "$$i"; $(MAKE) --silent NOT_FIRST_MAKE=t -f $(MAKEFILE_NAME) clean); \
     else \
       echo "Skipping makefile-less directory $$i..."; \