depend.mk, rules.mk: Move dependency rules from rules.mk to depend.mk

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-11-23 08:41:06 +00:00
commit e37efb1a5e
2 changed files with 18 additions and 22 deletions

View file

@ -4,8 +4,16 @@ DEPEND_CPPFLAGS += -D__MAKEDEPEND__
DEPEND_MK += $(addprefix .,$(addsuffix .dep.mk, $(OBJ)))
ifeq ($(DEPEND_MK_INCLUDED),)
# mandatory target behaviour
all:
clean: depclean
# convenience targets
dep: $(DEPEND_MK)
depclean:
$(RM) -f .*.dep.mk
$(DEPEND_MK): $(PREREQ_DONE)
ifneq ($(DEPEND_MK),)
ifeq ($(MAKECMDGOALS),)
@ -16,16 +24,16 @@ ifneq ($(DEPEND_MK),)
endif
endif
clean: depclean my_depclean
# convenience targets
dep: $(DEPEND_MK)
my_depclean:
$(RM) -f .*.dep.mk
# rules
$(DEPEND_MK): $(PREREQ_DONE)
%.o: .%.o.dep.mk
.%.o.dep.mk: %.cpp $(BUILD_HDR)
$(CC) -M $(BUILD_CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
.%.o.dep.mk: %.cc $(BUILD_HDR)
$(CC) -M $(BUILD_CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
.%.o.dep.mk: %.c $(BUILD_HDR)
$(CC) -M $(BUILD_CFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
endif # DEPEND_MK_INCLUDED
DEPEND_MK_INCLUDED := true