From 5110e9f79a36f4178e15438768d88092da9853f5 Mon Sep 17 00:00:00 2001 From: AranVink Date: Mon, 8 Jul 2024 00:46:19 +0200 Subject: [PATCH] Switch to UPX instead of strip (#9) --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b1753db..47da7d1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ INSTALL = install -STRIP = strip ZIP = zip prefix = /usr/local/djgpp @@ -47,7 +46,16 @@ dist: rm -r $(NAME) binarydist: adplay.exe - $(STRIP) adplay.exe + echo "Compressing adplay.exe" + @if which upx > /dev/null; then \ + upx --best adplay.exe; \ + elif which strip > /dev/null; then \ + echo "WARNING: Using strip, since upx is not found. Please consider installing upx since it gives the best compression of the binary. Also see UPX manpage https://github.com/upx/upx/blob/250c656b9eb24b0fb54fe8c015d38b0eba5ee80c/doc/upx-doc.txt#L272C6-L272C6 for additional information on upx vs strip."; \ + strip adplay.exe; \ + echo "strip completed"; \ + else \ + echo "ERROR: strip not found, please install either upx or strip" && exit 1; \ + fi rm -rf $(BINARYNAME).zip $(BINARYNAME) mkdir $(BINARYNAME) cp $(BINARYDIST) $(BINARYNAME)