-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (27 loc) · 1.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Generate tarball with new build of osx_vpn_manager
#
# NOTE: OSX only
VERSION=$$(cat main.go | grep -i "cliVersion =" | awk {'print$$3'} | tr -d '"')
BINARY_NAME=go-deploy
all: clean build compress report
clean:
@rm -f /tmp/$(BINARY_NAME)-*.tar.gz
@rm -f ./bin/$(BINARY_NAME)
build:
@echo Compiling resources/.. for version $(VERSION)
@go-bindata resources/...
@echo Building $(BINARY_NAME) version $(VERSION)
@env CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' -o ./bin/$(BINARY_NAME)-$(VERSION)
@cp ./bin/$(BINARY_NAME)-$(VERSION) ./bin/$(BINARY_NAME)
build-osx:
@echo Compiling resources/.. for version $(VERSION)
@go-bindata resources/...
@echo Building $(BINARY_NAME) version $(VERSION)
@env go build -a -tags netgo -ldflags '-w' -o ./bin/$(BINARY_NAME)-osx-$(VERSION)
@cp ./bin/$(BINARY_NAME)-osx-$(VERSION) ./bin/$(BINARY_NAME)-osx
compress:
@tar czf /tmp/$(BINARY_NAME)-$(VERSION).tar.gz ./versions
report:
@rm -f ./bin/$(BINARY_NAME)
@shasum -a 256 /tmp/$(BINARY_NAME)-$(VERSION).tar.gz
.PHONY: all clean build