summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen10do <Ben10do@users.noreply.github.com>2017-06-10 18:21:38 +0100
committerBen10do <Ben10do@users.noreply.github.com>2017-06-10 18:21:38 +0100
commitfc300ab0ee63a1ecbcead67c3a7019a0bfe8deb5 (patch)
treed2f8eb76b30d94217696a890d2159f91132cc5ca
parent848b3ba3ecbf110c168b4f37292bccdc6e3f2531 (diff)
Fix parallelisation issues in Makefile
Introduces a minor hack, in order to ensure that the tools are built before the Makefile attempts to use any of the tools, even when using ‘make -j’.
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index eb2e60148..19ca8e15a 100644
--- a/Makefile
+++ b/Makefile
@@ -29,8 +29,15 @@ crystal11_obj := $(crystal_obj:.o=11.o)
roms := pokecrystal.gbc pokecrystal11.gbc
all: crystal
-crystal: tools pokecrystal.gbc
-crystal11: tools pokecrystal11.gbc
+crystal: pokecrystal.gbc
+crystal11: pokecrystal11.gbc
+
+# Ensure that the tools are built when making the ROM
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),tools)
+Makefile: tools
+endif
+endif
clean:
rm -f $(roms) $(crystal_obj) $(crystal11_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym)