diff options
| author | mid-kid <esteve.varela@gmail.com> | 2022-10-25 18:02:29 +0200 |
|---|---|---|
| committer | mid-kid <esteve.varela@gmail.com> | 2022-10-25 18:02:29 +0200 |
| commit | 6bb3d82e7a11d2fbdada3e5a57e51d9ec7fff142 (patch) | |
| tree | 01c78d9e92e059166bace617ea07099684fbfd8a /Makefile | |
| parent | Add `COUNTOF` macro to tools/common.h (diff) | |
| download | pokeyellow-6bb3d82e7a11d2fbdada3e5a57e51d9ec7fff142.tar.gz pokeyellow-6bb3d82e7a11d2fbdada3e5a57e51d9ec7fff142.tar.xz pokeyellow-6bb3d82e7a11d2fbdada3e5a57e51d9ec7fff142.zip | |
Fix preinclude dependencies
From pokecrystal:
- 0425018d1ce5b3b726e3cd83f59f14ead9171c92
- 8b429e2a545e87407a3b8c7b92f7ceafc455e390
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -103,20 +103,21 @@ $(pokeblue_vc_obj): RGBASMFLAGS += -D _BLUE -D _BLUE_VC rgbdscheck.o: rgbdscheck.asm $(RGBASM) -o $@ $< +# Build tools when building the rom. +# This has to happen before the rules are processed, since that's when scan_includes is run. +ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS))) + +$(info $(shell $(MAKE) -C tools)) + # The dep rules have to be explicit or else missing files won't be reported. # As a side effect, they're evaluated immediately instead of when the rule is invoked. # It doesn't look like $(shell) can be deferred so there might not be a better way. +preinclude_deps := includes.asm $(shell tools/scan_includes includes.asm) define DEP -$1: $2 $$(shell tools/scan_includes $2) | includes.asm rgbdscheck.o +$1: $2 $$(shell tools/scan_includes $2) $(preinclude_deps) | rgbdscheck.o $$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$< endef -# Build tools when building the rom. -# This has to happen before the rules are processed, since that's when scan_includes is run. -ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS))) - -$(info $(shell $(MAKE) -C tools)) - # Dependencies for objects (drop _red and _blue from asm file basenames) $(foreach obj, $(pokered_obj), $(eval $(call DEP,$(obj),$(obj:_red.o=.asm)))) $(foreach obj, $(pokeblue_obj), $(eval $(call DEP,$(obj),$(obj:_blue.o=.asm)))) @@ -125,7 +126,7 @@ $(foreach obj, $(pokered_vc_obj), $(eval $(call DEP,$(obj),$(obj:_red_vc.o=.asm) $(foreach obj, $(pokeblue_vc_obj), $(eval $(call DEP,$(obj),$(obj:_blue_vc.o=.asm)))) # Dependencies for VC files that need to run scan_includes -%.constants.sym: %.constants.asm $(shell tools/scan_includes %.constants.asm) | includes.asm rgbdscheck.o +%.constants.sym: %.constants.asm $(shell tools/scan_includes %.constants.asm) $(preinclude_deps) | rgbdscheck.o $(RGBASM) $(RGBASMFLAGS) $< > $@ endif |
