ref: 449868849aededd4b21c601ba99f84978ff0dfcf
parent: 3f18c55fd588500b4f9d97c8c793db15659a91c9
author: Ralph Giles <[email protected]>
date: Mon Sep 17 05:12:28 EDT 2012
Don't include deps during 'make clean'. If a source file moves (as in the previous commit), any stale dependencies will block execution of 'make' because they define a dependency relationship to an non-existant file. The obvious thing to do is 'make clean' to get rid of the dependency files, but of course that fails the same way. To support this recovery, skip the include directive if the GNU make variable MAKECMDGOALS is 'clean', exempting this target from dependency checks. Based on an example in the GNU make manual.
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -178,5 +178,7 @@
mkdir -p ${dir $@}
${CC} ${CINCLUDE} ${CFLAGS} -c -o $@ $<
-# Include header file dependencies
+# Include header file dependencies, except when cleaning
+ifneq ($(MAKECMDGOALS),clean)
include ${ALL_DEPS}
+endif