User: Add header dependency tracking during build

This commit is contained in:
vit9696 2021-10-04 14:18:18 +03:00
parent a062e103ad
commit f7021d23de
2 changed files with 6 additions and 1 deletions

1
.gitignore vendored
View File

@ -37,6 +37,7 @@ Utilities/TestSmbios/Smbios
Utilities/TestPeCoff/PeCoff
*.o
*.o.tmp
*.d
*.exe
*.gcda
*.gcno

View File

@ -238,7 +238,11 @@ OBJS := $(addprefix $(OUT_DIR)/,$(OBJS))
$(OUT_DIR)/%.o: %.c
@$(MKDIR) $(OUT_DIR)
$(CC) $(CFLAGS) $< -o $@
$(CC) -MMD -MT $@ -MF $(OUT_DIR)/$*.d $(CFLAGS) $< -o $@
DEP := $(OBJS:%.o=%.d)
DEP_TEST := $(OBJ:%.o=%.d)
-include $(DEP) $(DEP_TEST)
all: $(PRODUCT)