From 8b429e2a545e87407a3b8c7b92f7ceafc455e390 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 25 Oct 2022 17:55:30 +0200 Subject: [PATCH] Make sure tools are built before dependencies are generated Avoids calling a program that doesn't exist yet (not actively harmful, but yeah...) --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 98e4715d6..a6a312d69 100644 --- a/Makefile +++ b/Makefile @@ -123,6 +123,12 @@ $(pokecrystal11_vc_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _CRYSTAL11_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. @@ -132,12 +138,6 @@ $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 shared objects objects $(foreach obj, $(pokecrystal_obj), $(eval $(call DEP,$(obj),$(obj:.o=.asm)))) $(foreach obj, $(pokecrystal11_obj), $(eval $(call DEP,$(obj),$(obj:11.o=.asm))))