build for many platforms, make it easier to install

This commit is contained in:
idk
2019-11-16 21:43:29 -05:00
parent 83918dfff8
commit dac3888397

View File

@@ -3,8 +3,11 @@ VERSION=0.0.1
APP=i2p-tools-1
USER_GH=eyedeekay
GOOS?=$(shell uname -s | tr A-Z a-z)
GOARCH?="amd64"
echo:
@echo "type make version to do release $(APP) $(VERSION)"
@echo "type make version to do release $(APP) $(VERSION) $(GOOS) $(GOARCH) "
version:
cat README.md | gothub release -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(APP) -t v$(VERSION) -d -
@@ -12,12 +15,28 @@ version:
edit:
cat README.md | gothub edit -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(APP) -t v$(VERSION) -d -
upload:
gothub upload -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(APP) -t v$(VERSION) -f ../i2p-tools.tar.xz -n "i2p-tools.tar.xz"
build:
go build -v -tags netgo \
-ldflags '-w -extldflags "-static"' -o i2p-tools
-ldflags '-w -extldflags "-static"' -o i2p-tools-$(GOOS)-$(GOARCH)
binary:
GOOS=darwin GOARCH=amd64 make build
GOOS=linux GOARCH=386 make build
GOOS=linux GOARCH=amd64 make build
GOOS=linux GOARCH=arm make build
GOOS=linux GOARCH=arm64 make build
GOOS=openbsd GOARCH=amd64 make build
GOOS=freebsd GOARCH=386 make build
GOOS=freebsd GOARCH=amd64 make build
tar:
tar --exclude="./.git" --exclude="./tmp" -cvf ../i2p-tools.tar.xz .
install:
install -m755 i2p-tools /usr/local/bin/i2p-tools
install -m755 i2p-tools-$(GOOS)-$(GOARCH) /usr/local/bin/i2p-tools
install -m755 etc/init.d/reseed /etc/init.d/reseed
### You shouldn't need to use these now that the go mod require rule is fixed,