summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-06-20 22:03:16 -0700
committerMarcus Huderle <huderlem@gmail.com>2017-06-20 22:03:16 -0700
commite235064ebc8bc17cb41eeed9e456f5b301433729 (patch)
tree2be9ea4e553663e14b59bc48c1a7064394dab7e8 /Makefile
parent4ae72eeb6a790da0a26d174e52338dbe424fcef2 (diff)
Remove baserom.gbc dependency. We made it!
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile19
1 files changed, 9 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 43d9a51..3cb79c0 100755
--- a/Makefile
+++ b/Makefile
@@ -5,19 +5,20 @@
.SECONDEXPANSION:
# Build Pokemon Pinball.
-ROMS := pokepinball.gbc
+ROM := pokepinball.gbc
OBJS := main.o wram.o sram.o
# If your default python is 3, you may want to change this to python27.
PYTHON := python
PRET := pokemon-reverse-engineering-tools/pokemontools
+MD5 := md5sum -c --quiet
$(foreach obj, $(OBJS), \
$(eval $(obj:.o=)_dep := $(shell $(PYTHON) $(PRET)/scan_includes.py $(obj:.o=.asm))) \
)
# Link objects together to build a rom.
-all: $(ROMS) compare
+all: $(ROM) compare
# Assemble source files into objects.
# Use rgbasm -h to use halts without nops.
@@ -27,19 +28,17 @@ $(OBJS): $$*.asm $$($$*_dep)
@$(PYTHON) $(PRET)/pcm.py pcm $(pcmq)
rgbasm -h -o $@ $<
-$(ROMS): $(OBJS)
- rgblink -n $(ROMS:.gbc=.sym) -m $(ROMS:.gbc=.map) -o $@ $^
+$(ROM): $(OBJS)
+ rgblink -n $(ROM:.gbc=.sym) -m $(ROM:.gbc=.map) -o $@ $^
rgbfix -jsvc -k 01 -l 0x33 -m 0x1e -p 0 -r 02 -t "POKEPINBALL" -i VPHE $@
-# The compare target is a shortcut to check that the build matches the original roms exactly.
-# This is for contributors to make sure a change didn't affect the contents of the rom.
-# More thorough comparison can be made by diffing the output of hexdump -C against both roms.
-compare: $(ROMS) baserom.gbc
- cmp $^
+# For contributors to make sure a change didn't affect the contents of the rom.
+compare: $(ROM)
+ @$(MD5) rom.md5
# Remove files generated by the build process.
tidy:
- rm -f $(ROMS) $(OBJS) $(ROMS:.gbc=.sym)
+ rm -f $(ROM) $(OBJS) $(ROM:.gbc=.sym)
clean: tidy
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pcm' \) -exec rm {} +