aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2023-04-25 19:52:12 -0500
committerdannye <33dannye@gmail.com>2023-04-25 19:52:12 -0500
commit667f1febbe59355b1ffea68619e5e5486fd3c408 (patch)
tree9a3ca97fea7cb54d1db9c23ac8c2a405a13f6f5c /Makefile
parentFix trainer parties' comments (#104) (diff)
parentUpdate `EndBug` to v9. (diff)
downloadpokeyellow-667f1febbe59355b1ffea68619e5e5486fd3c408.tar.gz
pokeyellow-667f1febbe59355b1ffea68619e5e5486fd3c408.tar.xz
pokeyellow-667f1febbe59355b1ffea68619e5e5486fd3c408.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 9 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 78d44bb6..5eb584b1 100644
--- a/Makefile
+++ b/Makefile
@@ -96,27 +96,28 @@ $(pokeyellow_vc_obj): RGBASMFLAGS += -D _YELLOW_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
$(foreach obj, $(pokeyellow_obj), $(eval $(call DEP,$(obj),$(obj:.o=.asm))))
$(foreach obj, $(pokeyellow_debug_obj), $(eval $(call DEP,$(obj),$(obj:_debug.o=.asm))))
$(foreach obj, $(pokeyellow_vc_obj), $(eval $(call DEP,$(obj),$(obj:_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