Commit 44986884 authored by Ralph Giles's avatar Ralph Giles
Browse files

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.
parent 3f18c55f
......@@ -178,5 +178,7 @@ ${WORKDIR}/%.o : ${BINSRCDIR}/%.c
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}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment