summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-06-24 19:06:37 -0400
committerGitHub <noreply@github.com>2017-06-24 19:06:37 -0400
commit60f6430d05cb858df709f6bd87ef02526bb12077 (patch)
tree17edb04dcd0fd09d0d14459ea5566093305b04dd /Makefile
parentd0d61cb3ab847ff0c72a840363b89d4acf05b5f5 (diff)
parent0fbc74a8c7596455b1cf33e1ff8c499215e1c1e1 (diff)
Merge pull request #371 from yenatch/graphics
Use sha1sum instead of md5sum to compare roms
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 61f1b6c8a..3382d9a41 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,8 @@
-MD5 := md5sum -c
+ifeq (,$(shell which sha1sum))
+SHA1 := shasum
+else
+SHA1 := sha1sum
+endif
.SUFFIXES:
.PHONY: all clean tools compare crystal crystal11
@@ -36,7 +40,7 @@ clean:
rm -f $(roms) $(crystal_obj) $(crystal11_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym)
compare: $(roms)
- @$(MD5) roms.md5
+ @$(SHA1) -c roms.sha1
tools:
make -C tools/
@@ -58,11 +62,11 @@ pokecrystal.gbc: $(crystal_obj)
rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
-# For files that the compressor can't match, there will be a .lz file suffixed with the hash of the correct uncompressed file.
+# For files that the compressor can't match, there will be a .lz file suffixed with the md5 hash of the correct uncompressed file.
# If the hash of the uncompressed file matches, use this .lz instead.
# This allows pngs to be used for compressed graphics and still match.
-%.lz: hash = $(shell md5sum $(*D)/$(*F) | sed "s/\(.\{8\}\).*/\1/")
+%.lz: hash = $(shell tools/md5 $(*D)/$(*F) | sed "s/\(.\{8\}\).*/\1/")
%.lz: %
$(eval filename := $@.$(hash))
$(if $(wildcard $(filename)),cp $(filename) $@,tools/lzcomp $< $@)