Skip to content

Commit

Permalink
updates makefile
Browse files Browse the repository at this point in the history
changes bash statically linked version
strips linux binary to reduce size #
detects if upx is installed and if so, compress to further reduce binary sizes
  • Loading branch information
mathieu-aubin committed Feb 11, 2020
1 parent 4faca4c commit 213414f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NAME=go-basher
OWNER=progrium
BASH_DIR=.bash
BASH_STATIC_VERSION=5.0

test:
go test -v
Expand All @@ -14,11 +15,18 @@ deps:
bash:
# Don't run if you don't have to. Adds several megs to repo with every commit.
rm -rf $(BASH_DIR) && mkdir -p $(BASH_DIR)/linux $(BASH_DIR)/osx
curl -Ls https://github.com/robxu9/bash-static/releases/download/4.3.30/bash-linux \
> $(BASH_DIR)/linux/bash
curl -Ls https://github.com/robxu9/bash-static/releases/download/4.3.30/bash-osx \

curl -#SLk https://github.com/robxu9/bash-static/releases/download/$(BASH_STATIC_VERSION)/bash-linux \
> $(BASH_DIR)/linux/bash && strip $(BASH_DIR)/linux/bash

curl -#SLk https://github.com/robxu9/bash-static/releases/download/$(BASH_STATIC_VERSION)/bash-osx \
> $(BASH_DIR)/osx/bash
chmod +x $(BASH_DIR)/**/*

chmod +x $(BASH_DIR)/*/bash

# if upx is present, compress bash binaries
if [ `command -v upx` ]; then upx --8mib-ram --best --brute --ultra-brute -9 $(BASH_DIR)/*/bash; fi

go-bindata -tags=linux -o=bash_linux.go -prefix=$(BASH_DIR)/linux -pkg=basher $(BASH_DIR)/linux
go-bindata -tags=darwin -o=bash_darwin.go -prefix=$(BASH_DIR)/osx -pkg=basher $(BASH_DIR)/osx

Expand Down

0 comments on commit 213414f

Please sign in to comment.