mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
depend.mk, rules.mk: Fix dependency checking
Fix dependency checking, create seperate depfiles for every object file.
This commit is contained in:
parent
87f4f09458
commit
5447b4cdb4
2 changed files with 23 additions and 8 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue