From 041ff613ca992934c4ea1e9784a98acf01e766aa Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Tue, 7 Apr 2026 15:03:44 +0100 Subject: [PATCH] Generate '.d' files for 'maps.s' and 'map_events.s' (#2279) Previously, 'data/maps.o' and 'data/map_events.o' were not rebuilt if any of the header files they '#include' are modified. You can verify this via 'make' with something like: $ make -n -W include/constants/songs.h | grep maps.o which shows that 'data/maps.o' is not rebuilt. Or by modifying a header included in 'data/maps.s' in a way that should break assembling it (e.g. by removing a '#define' that is only used in 'data/maps.s'). Additionally, fixes a bug in Expansion from an interaction between 'preproc -e' generating (global) symbols and those symbols being generated for multiple object files, and thus falling out of sync between (e.g.) 'data/map_events.o' and 'data/event_scripts.o', resulting in an unhelpful multiple definition error from the linker like: arm-none-eabi-ld: data/map_events.o: in function `ITEM_TM01': (*ABS*+0x247): multiple definition of `ITEM_TM01' --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 754ecebe36..258c12f37d 100644 --- a/Makefile +++ b/Makefile @@ -203,9 +203,6 @@ C_ASM_OBJS := $(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o,$(C_ASM_SRCS)) ASM_SRCS := $(wildcard $(ASM_SUBDIR)/*.s) ASM_OBJS := $(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o,$(ASM_SRCS)) -# get all the data/*.s files EXCEPT the ones with specific rules -REGULAR_DATA_ASM_SRCS := $(filter-out $(DATA_ASM_SUBDIR)/maps.s $(DATA_ASM_SUBDIR)/map_events.s, $(wildcard $(DATA_ASM_SUBDIR)/*.s)) - DATA_ASM_SRCS := $(wildcard $(DATA_ASM_SUBDIR)/*.s) DATA_ASM_OBJS := $(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o,$(DATA_ASM_SRCS)) @@ -348,7 +345,7 @@ $(DATA_ASM_BUILDDIR)/%.d: $(DATA_ASM_SUBDIR)/%.s $(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $< ifneq ($(NODEP),1) --include $(addprefix $(OBJ_DIR)/,$(REGULAR_DATA_ASM_SRCS:.s=.d)) +-include $(addprefix $(OBJ_DIR)/,$(DATA_ASM_SRCS:.s=.d)) endif $(OBJ_DIR)/sym_bss.ld: sym_bss.txt