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