aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-10-20 17:59:39 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-10-20 17:59:39 +0530
commit56757860d438c3ab346447f20e996011407360a2 (patch)
tree12f144c3126f8b658febbe96c5f0cbd0a60c65b9
parent234f7ae563e8291e35045405de90cd428b5c5d1e (diff)
downloadnnn-56757860d438c3ab346447f20e996011407360a2.tar.gz
Generate static binaries with icon support
-rw-r--r--Makefile21
1 files changed, 20 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4a8d2b0..357792a 100644
--- a/Makefile
+++ b/Makefile
@@ -162,8 +162,15 @@ strip: $(BIN)
$(STRIP) $^
static:
+ # regular static binary
make O_STATIC=1 strip
mv $(BIN) $(BIN)-static
+ # static binary with icons-in-terminal support
+ make O_STATIC=1 O_ICONS=1 strip
+ mv $(BIN) $(BIN)-icons-static
+ # static binary with patched nerd font support
+ make O_STATIC=1 O_NERD=1 strip
+ mv $(BIN) $(BIN)-nerd-static
dist:
mkdir -p nnn-$(VERSION)
@@ -178,16 +185,28 @@ sign:
upload-local: sign static
$(eval ID=$(shell curl -s 'https://api.github.com/repos/jarun/nnn/releases/tags/v$(VERSION)' | jq .id))
+ # upload sign file
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=nnn-$(VERSION).tar.gz.sig' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/pgp-signature' \
--upload-file nnn-$(VERSION).tar.gz.sig
tar -zcf $(BIN)-static-$(VERSION).x86_64.tar.gz $(BIN)-static
+ # upload static binary
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-static-$(VERSION).x86_64.tar.gz' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
--upload-file $(BIN)-static-$(VERSION).x86_64.tar.gz
+ tar -zcf $(BIN)-icons-static-$(VERSION).x86_64.tar.gz $(BIN)-icons-static
+ # upload icons-in-terminal compiled static binary
+ curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-icons-static-$(VERSION).x86_64.tar.gz' \
+ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
+ --upload-file $(BIN)-icons-static-$(VERSION).x86_64.tar.gz
+ # upload patched nerd font compiled static binary
+ tar -zcf $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz $(BIN)-nerd-static
+ curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-nerd-static-$(VERSION).x86_64.tar.gz' \
+ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
+ --upload-file $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz
clean:
- $(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig $(BIN)-static $(BIN)-static-$(VERSION).x86_64.tar.gz
+ $(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig $(BIN)-static $(BIN)-static-$(VERSION).x86_64.tar.gz $(BIN)-icons-static $(BIN)-icons-static-$(VERSION).x86_64.tar.gz $(BIN)-nerd-static $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz
skip: ;