Still... having problems with auto-depends on when running building Windows.
[reactos.git] / reactos / tools / depend.mk
1 # Automatic dependancy tracking
2 # Define $DEP_OBJECTS before this file is included
3 # $DEP_OBJECTS contain a list of object files that are checked for dependancies
4
5 DEP_FILTERED := $(filter-out $(DEP_EXCLUDE_FILTER), $(DEP_OBJECTS:.o=.d))
6 DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED))))
7
8
9 ifneq ($(MAKECMDGOALS),clean)
10 include $(DEP_FILES)
11 endif
12
13 ifeq ($(SEP),\)
14 DEPENDS_PATH := $(subst /,\,$(PATH_TO_TOP))\tools\
15 else
16 DEPENDS_PATH := $(PATH_TO_TOP)/tools/
17 endif
18
19 .%.d: %.c $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
20 $(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
21
22 .%.d: %.cc $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
23 $(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
24
25 .%.d: %.cpp $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
26 $(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
27
28 .%.d: %.s $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
29 $(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
30
31 .%.d: %.S $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
32 $(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
33
34 .%.d: %.asm $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX)
35 $(NASM_CMD) $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@