From 2112d5d992e8805533db693148e423fed5b51b53 Mon Sep 17 00:00:00 2001 From: Jcw87 Date: Fri, 6 Jan 2023 18:28:25 -0800 Subject: [PATCH] header dependency tracking might be useful for main.dol too --- Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8a5cbc7ff9d..2ff44c50cf2 100644 --- a/Makefile +++ b/Makefile @@ -192,17 +192,25 @@ rungame: game dolphin-emu $(BUILD_DIR)/game/sys/main.dol # -$(BUILD_DIR)/%.o: %.c +$(BUILD_DIR)/%.o: %.c $(BUILD_DIR)/%.d @mkdir -p $(@D) @echo building... $< @$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).c - @$(CC) $(CFLAGS) -c -o $@ $(basename $@).c + @$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $(dir $@) $(basename $@).c + @if [ -z '$(DISABLE_DEPS)' ]; then tools/transform-dep.py '$(basename $@).d' '$(basename $@).d'; touch -c $@; fi -$(BUILD_DIR)/%.o: %.cpp +$(BUILD_DIR)/%.o: %.cpp $(BUILD_DIR)/%.d @mkdir -p $(@D) @echo building... $< @$(ICONV) -f UTF-8 -t CP932 < $< > $(basename $@).cpp - @$(CC) $(CFLAGS) -c -o $@ $(basename $@).cpp + @$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $(dir $@) $(basename $@).cpp + @if [ -z '$(DISABLE_DEPS)' ]; then tools/transform-dep.py '$(basename $@).d' '$(basename $@).d'; touch -c $@; fi + +ifndef DISABLE_DEPS +D_FILES := $(O_FILES:.o=.d) +$(D_FILES): +include $(wildcard $(D_FILES)) +endif # shared cpp files for RELs $(BUILD_DIR)/rel/%.o: rel/%.cpp