Generate '.d' files for 'maps.s' and 'map_events.s' (#2279)
Some checks failed
CI / build (push) Has been cancelled

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'
This commit is contained in:
Martin Griffin 2026-04-07 15:03:44 +01:00 committed by GitHub
parent 30185ea16b
commit 041ff613ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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