diff --git a/Makefile b/Makefile index ef796bc..2c2950c 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,13 @@ image_eif := $(prog).eif cover_out = cover.out cover_html = cover.html +# Use sha1sum on Linux and sha1 on macOS. +ifeq ($(shell uname),Darwin) + hash = sha1 +else + hash = sha1sum +endif + all: $(prog) .PHONY: lint @@ -83,11 +90,11 @@ $(prog): $(godeps) -ldflags="-s -w" \ -buildvcs=false \ -o $(prog) - @sha1sum "$(prog_dir)/$(prog)" + @$(hash) "$(prog_dir)/$(prog)" $(verify_prog): $(godeps) @go build -C $(verify_prog_dir) -o $(verify_prog) - @sha1sum "$(verify_prog_dir)/$(verify_prog)" + @$(hash) "$(verify_prog_dir)/$(verify_prog)" .PHONY: clean clean: