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