Skip to content

Commit

Permalink
User: Add header dependency tracking during build
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Oct 4, 2021
1 parent a062e10 commit f7021d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Utilities/TestSmbios/Smbios
Utilities/TestPeCoff/PeCoff
*.o
*.o.tmp
*.d
*.exe
*.gcda
*.gcno
Expand Down
6 changes: 5 additions & 1 deletion User/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f7021d2

Please sign in to comment.