summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2018-01-23 00:36:44 -0500
committeryenatch <yenatch@gmail.com>2018-01-23 00:36:44 -0500
commit51b9b47e2d0299c5fcca8f08ea059208e82a5fe2 (patch)
tree8f255fd9499111c168068537efe4210eaa1eeb6d
parenta37cc479cd6133c14debde87cb6a624893a68fb2 (diff)
fix unhelpful errors when missing prerequisites in implcit rules
-rw-r--r--Makefile12
1 files 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)