rules.mak: include ${DEPEND_FILE} only if the file exists

This is a modified fix to the "make clean; make clean" issue.
'clean' is not the only target affected.
This commit is contained in:
Darryl L. Miles 2024-10-16 10:39:54 +01:00 committed by R. Timothy Edwards
parent 3aebbbd038
commit d1ff3671cd
1 changed files with 3 additions and 3 deletions

View File

@ -53,8 +53,8 @@ clean:
tags: ${SRCS} ${LIB_SRCS}
ctags ${SRCS} ${LIB_SRCS}
# If "include" is unqualified, it will attempt to build all targets of "include"
# So, we gate the include, only running it if "clean" is not the target
ifneq ($(MAKECMDGOALS),clean)
# Depends are a somewhat optional part of the build process that are only useful when incremental
# building. If the file is here it's here, if not continue with build optimistically
ifneq (,$(wildcard ${DEPEND_FILE}))
include ${DEPEND_FILE}
endif