depend.mk, rules.mk: Fix dependency checking

Fix dependency checking, create seperate depfiles for every object
file.
This commit is contained in:
Jan Lindemann 2006-03-04 13:41:35 +00:00 committed by Jan Lindemann
commit 5447b4cdb4
2 changed files with 23 additions and 8 deletions

View file

@ -1,11 +1,22 @@
DEPEND_CFLAGS += -D__MAKEDEPEND__
DEPEND_CPPFLAGS += -D__MAKEDEPEND__
all.done: depend.mk
DEPEND_MK = $(addprefix .,$(addsuffix .dep.mk, $(OBJ)))
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
-include depend.mk
ifneq ($(DEPEND_MK),)
-include $(DEPEND_MK)
endif
endif
endif
clean: depclean
clean: depclean my_depclean
my_depclean:
rm -f .*.dep.mk
%.o: .%.o.dep.mk

View file

@ -187,12 +187,16 @@ endif
#depend.mk: $(SRC_ALL_CPP)
# > $@ && makedepend -f depend.mk -- $(CPPFLAGS) $(DEPEND_CPPFLAGS) -- $(SRC_ALL_CPP) 2>&1 | sed '/non-portable whitespace/ d'
depend.mk: $(filter-out %.h, $(SRC_ALL_CPP) $(PREREQ_DONE))
> $@ && if [ "$(wildcard *.cpp *.c)" ]; then \
gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $(filter-out %.h,$(SRC_ALL_CPP)) -o $@; \
fi
#depend.mk: $(filter-out %.h, $(SRC_ALL_CPP) $(PREREQ_DONE))
# > $@ && if [ "$(wildcard *.cpp *.c)" ]; then \
# gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $(filter-out %.h,$(SRC_ALL_CPP)) -o $@; \
# fi
depend: depend.mk
.%.o.dep.mk: %.cpp
gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
.%.o.dep.mk: %.c
gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
checkroot:
@if [ "$(CHECK_ROOT)" = true -o "$(CHECK_ROOT)" = TRUE ] ; then \