From 51b9b47e2d0299c5fcca8f08ea059208e82a5fe2 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 23 Jan 2018 00:36:44 -0500 Subject: fix unhelpful errors when missing prerequisites in implcit rules --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index cd11913f..ede34e04 100644 --- a/Makefile +++ b/Makefile @@ -33,12 +33,16 @@ compare: pokegold.gbc pokesilver.gbc %.asm: ; -%_gold.o: dep = $(shell $(includes) $(@D)/$*.asm) -%_gold.o: %.asm $$(dep) +define DEP +$1: $$(shell $$(includes) $2) +endef +$(foreach obj, $(gold_obj), $(eval $(call DEP,$(obj),$(obj:_gold.o=.asm)))) +$(foreach obj, $(silver_obj), $(eval $(call DEP,$(obj),$(obj:_silver.o=.asm)))) + +$(gold_obj): %_gold.o: %.asm $$(dep) rgbasm -D GOLD -o $@ $< -%_silver.o: dep = $(shell $(includes) $(@D)/$*.asm) -%_silver.o: %.asm $$(dep) +$(silver_obj): %_silver.o: %.asm $$(dep) rgbasm -D SILVER -o $@ $< pokegold.gbc: $(gold_obj) -- cgit v1.2.3