forked from jessepeterson/mysqlscepserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (23 loc) · 770 Bytes
/
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
VERSION = $(shell git describe --tags --always --dirty)
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
OSARCH=$(shell go env GOHOSTOS)-$(shell go env GOHOSTARCH)
MYSQLSCEPSERVER=\
mysqlscepserver-darwin-amd64 \
mysqlscepserver-darwin-arm64 \
mysqlscepserver-linux-amd64
my: mysqlscepserver-$(OSARCH)
docker: mysqlscepserver-linux-amd64
$(MYSQLSCEPSERVER):
GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./$<
%-$(VERSION).zip: %.exe
rm -f $@
zip $@ $<
%-$(VERSION).zip: %
rm -f $@
zip $@ $<
clean:
rm -f mysqlscepserver-*
release: $(foreach bin,$(MYSQLSCEPSERVER),$(subst .exe,,$(bin))-$(VERSION).zip)
test:
go test -v -cover -race ./...
.PHONY: my docker $(MYSQLSCEPSERVER) clean release test