From 503f6d86d5fca5bd234640ef9de597d413cb91f5 Mon Sep 17 00:00:00 2001 From: Tharo <17233964+Thar0@users.noreply.github.com> Date: Fri, 20 Oct 2023 18:14:52 +0100 Subject: [PATCH] Track most header dependencies for `include/tables` headers (#1566) * Makefile automatically rebuild source files including headers from include/tables * Fix typo, make z_actor.c also depend on actor_table.h * Add message data dependencies for z_message_PAL, adjust comments --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 5f5b628c90..e292f566da 100644 --- a/Makefile +++ b/Makefile @@ -316,10 +316,13 @@ build/data/%.o: data/%.s build/assets/text/%.enc.h: assets/text/%.h assets/text/charmap.txt python3 tools/msgenc.py assets/text/charmap.txt $< $@ +# Dependencies for files including message data headers +# TODO remove when full header dependencies are used. build/assets/text/fra_message_data_static.o: build/assets/text/message_data.enc.h build/assets/text/ger_message_data_static.o: build/assets/text/message_data.enc.h build/assets/text/nes_message_data_static.o: build/assets/text/message_data.enc.h build/assets/text/staff_message_data_static.o: build/assets/text/message_data_staff.enc.h +build/src/code/z_message_PAL.o: build/assets/text/message_data.enc.h build/assets/text/message_data_staff.enc.h build/assets/%.o: assets/%.c $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< @@ -331,9 +334,20 @@ build/src/%.o: src/%.s build/dmadata_table_spec.h: build/$(SPEC) $(MKDMADATA) $< $@ +# Dependencies for files that may include the dmadata header automatically generated from the spec file build/src/boot/z_std_dma.o: build/dmadata_table_spec.h build/src/dmadata/dmadata.o: build/dmadata_table_spec.h +# Dependencies for files including from include/tables/ +# TODO remove when full header dependencies are used. +build/src/code/graph.o: include/tables/gamestate_table.h +build/src/code/object_table.o: include/tables/object_table.h +build/src/code/z_actor.o: include/tables/actor_table.h # so uses of ACTOR_ID_MAX update when the table length changes +build/src/code/z_actor_dlftbls.o: include/tables/actor_table.h +build/src/code/z_effect_soft_sprite_dlftbls.o: include/tables/effect_ss_table.h +build/src/code/z_game_dlftbls.o: include/tables/gamestate_table.h +build/src/code/z_scene_table.o: include/tables/scene_table.h include/tables/entrance_table.h + build/src/%.o: src/%.c $(CC_CHECK) $< $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<