explicitly manage .depend and .depend.bak

Bring back removal of .depend to give the file a known state before
running makedepend, but manually move aside the current .depend file
and restore it as .depend.bak afterwards so the stale .depend check
works as expected.
This commit is contained in:
Damien Miller 2020-05-13 12:08:34 +10:00
parent 83a6dc6ba1
commit 102d106bc2
1 changed files with 4 additions and 1 deletions

View File

@ -350,12 +350,15 @@ depend: depend-rebuild
rm -f .depend.bak rm -f .depend.bak
depend-rebuild: depend-rebuild:
rm -f config.h mv .depend .depend.old
rm -f config.h .depend
touch config.h .depend touch config.h .depend
makedepend -w1000 -Y. -f .depend *.c 2>/dev/null makedepend -w1000 -Y. -f .depend *.c 2>/dev/null
(echo '# Automatically generated by makedepend.'; \ (echo '# Automatically generated by makedepend.'; \
echo '# Run "make depend" to rebuild.'; sort .depend ) >.depend.tmp echo '# Run "make depend" to rebuild.'; sort .depend ) >.depend.tmp
mv .depend.tmp .depend mv .depend.tmp .depend
rm -f .depend.bak
mv .depend.old .depend.bak
rm -f config.h rm -f config.h
depend-check: depend-rebuild depend-check: depend-rebuild