slightly closer but cleanups are still wrong.
[feisty_meow.git] / scripts / clam / rules.def
index 367f8f190e9d63d2cc0c8d4dbe9180571c6af176..8d41bf95f75263548c04ddb4a6ff7f3423d14d66 100644 (file)
@@ -98,7 +98,7 @@ 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: 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:
@@ -107,10 +107,18 @@ 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 \
@@ -118,10 +126,8 @@ 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: