-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
29 lines (22 loc) · 1.13 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
BINARY:=sslcheck
PWD:=$(shell pwd)
VERSION=0.0.0
MONOVA:=$(shell which monova dot 2> /dev/null)
version:
ifdef MONOVA
override VERSION=$(shell monova)
else
$(info "Install monova (https://github.com/jsnjack/monova) to calculate version")
endif
bin/${BINARY}: bin/${BINARY}_linux_amd64
cp bin/${BINARY}_linux_amd64 bin/${BINARY}
bin/${BINARY}_linux_amd64: version *.go
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-X github.com/jsnjack/sslcheck/cmd.Version=${VERSION}" -o bin/${BINARY}_linux_amd64
bin/${BINARY}_darwin_amd64: version *.go
GOOS=darwin GOARCH=amd64 go build -ldflags="-X github.com/jsnjack/sslcheck/cmd.Version=${VERSION}" -o bin/${BINARY}_darwin_amd64
build: bin/${BINARY} bin/${BINARY}_linux_amd64 bin/${BINARY}_darwin_amd64
release: build
tar --transform='s,_.*,,' --transform='s,bin/,,' -cz -f bin/${BINARY}_linux_amd64.tar.gz bin/${BINARY}_linux_amd64
tar --transform='s,_.*,,' --transform='s,bin/,,' -cz -f bin/${BINARY}_darwin_amd64.tar.gz bin/${BINARY}_darwin_amd64
grm release jsnjack/${BINARY} -f bin/${BINARY}_linux_amd64.tar.gz -f bin/${BINARY}_darwin_amd64.tar.gz -t "v`monova`"
.PHONY: version release build