Makefile | 12 ++++++++++-- misc/haiku/Makefile | 12 ++++++++++-- diff --git a/Makefile b/Makefile index 44849a6795f266ab4180c4a1ba690ec2b29bf45a..ce2eb93f3ee7f0f636ff5ead60f078ca8d9565ff 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,10 @@ strip: $(BIN) $(STRIP) $^ +static: + make O_STATIC=1 strip + mv $(BIN) $(BIN)-static + dist: mkdir -p nnn-$(VERSION) $(CP) -r $(DISTFILES) nnn-$(VERSION) @@ -108,14 +112,18 @@ git archive -o nnn-$(VERSION).tar.gz --format tar.gz --prefix=nnn-$(VERSION)/ v$(VERSION) gpg --detach-sign --yes nnn-$(VERSION).tar.gz rm -f nnn-$(VERSION).tar.gz +upload-local: sign static $(eval ID=$(shell curl -s 'https://api.github.com/repos/jarun/nnn/releases/tags/v$(VERSION)' | jq .id)) 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 + curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=nnn-$(VERSION)-static' \ + -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ + --upload-file $(BIN)-static clean: - $(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig + $(RM) -f $(BIN) $(BIN)-static nnn-$(VERSION).tar.gz *.sig skip: ; -.PHONY: all install uninstall strip dist sign clean +.PHONY: all install uninstall strip static dist sign upload-local clean diff --git a/misc/haiku/Makefile b/misc/haiku/Makefile index 843df9d91ccd761934d8d8839b6306252c65ddb3..1568855771477ebb67aac25a06bce25f51178d17 100644 --- a/misc/haiku/Makefile +++ b/misc/haiku/Makefile @@ -100,6 +100,10 @@ strip: $(BIN) $(STRIP) $^ +static: + make O_STATIC=1 strip + mv $(BIN) $(BIN)-static + dist: mkdir -p nnn-$(VERSION) $(CP) -r $(DISTFILES) nnn-$(VERSION) @@ -113,14 +117,18 @@ git archive -o nnn-$(VERSION).tar.gz --format tar.gz --prefix=nnn-$(VERSION)/ v$(VERSION) gpg --detach-sign --yes nnn-$(VERSION).tar.gz rm -f nnn-$(VERSION).tar.gz +upload-local: sign static $(eval ID=$(shell curl -s 'https://api.github.com/repos/jarun/nnn/releases/tags/v$(VERSION)' | jq .id)) 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 + curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=nnn-$(VERSION)-static' \ + -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ + --upload-file $(BIN)-static clean: - $(RM) -f $(BIN) $(OBJS) nnn-$(VERSION).tar.gz *.sig + $(RM) -f $(BIN) $(BIN)-static $(OBJS) nnn-$(VERSION).tar.gz *.sig skip: ; -.PHONY: all install uninstall strip dist sign clean +.PHONY: all install uninstall strip static dist sign upload-local clean