Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -92,23 +92,25 @@ depend: pre-depend ${SRCS} regen=0; \ test -f .deps || regen=1; \ for i in ${SRCS}; do test $$i -nt .deps && regen=1; done; \ - if test x"$$regen" = x"1"; then \ + if test x"$$regen" = x"1" -a x"${DEPS}" != "x"; then \ ${DEPEND_STATUS}; \ rm -f .deps; \ if ${MAKE} ${MFLAGS} ${DEPS}; then \ + cat ${DEPS} >.deps; \ + rm -f ${DEPS}; \ ${DEPEND_OK}; \ else \ - rm -f .deps; \ + rm -f .deps ${DEPS}; \ ${DEPEND_FAILED}; \ fi; \ fi .c.dep .cc.dep .cxx.dep .m.dep: - ${CPP} ${CPPFLAGS} -M $< >>.deps + ${CPP} ${CPPFLAGS} -M $< >$@ .d.dep: pre-depend: @@ -350,11 +352,11 @@ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} clean || exit 1; \ ${DIR_LEAVE}; \ done - for i in ${OBJS} ${CLEAN} ${CLEAN_LIB} .deps; do \ + for i in ${OBJS} ${CLEAN} ${CLEAN_LIB} .deps ${DEPS}; do \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \