From f12e42ab6d41740a6e9302f1f12250a0f72c3f9d Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 24 Jun 2017 18:32:54 -0400 Subject: Use SHA1 to compare roms --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 61f1b6c8a..b51652a00 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/ -- cgit v1.2.3 From f03b898250597680f115cec5cec06953b403acf9 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 24 Jun 2017 18:34:25 -0400 Subject: Add a md5 tool to avoid md5sum dependency. md5sum is missing in macOS and (presumably) BSD. An alternative would have been to use sha1sum instead, but it's probably a good idea to have as few dependencies as possible, so this doesn't happen again. fixes #364 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b51652a00..3382d9a41 100644 --- a/Makefile +++ b/Makefile @@ -62,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 $< $@) -- cgit v1.2.3