-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
36 lines (24 loc) · 847 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
34
35
36
EXECUTABLE=assocentity
VERSION=$(shell git describe --tags --always --long --dirty)
WINDOWS=$(EXECUTABLE)_windows_amd64_$(VERSION).exe
LINUX=$(EXECUTABLE)_linux_amd64_$(VERSION)
DARWIN=$(EXECUTABLE)_darwin_amd64_$(VERSION)
.PHONY: all test clean
all: test clean build
test:
go test ./... -short
test_full:
go test ./...
build: windows linux darwin
@echo version: $(VERSION)
windows: $(WINDOWS)
linux: $(LINUX)
darwin: $(DARWIN)
$(WINDOWS):
env GOOS=windows GOARCH=amd64 go build -v -o bin/$(WINDOWS) -ldflags="-s -w -X main.version=$(VERSION)" ./cli/main.go
$(LINUX):
env GOOS=linux GOARCH=amd64 go build -v -o bin/$(LINUX) -ldflags="-s -w -X main.version=$(VERSION)" ./cli/main.go
$(DARWIN):
env GOOS=darwin GOARCH=amd64 go build -v -o bin/$(DARWIN) -ldflags="-s -w -X main.version=$(VERSION)" ./cli/main.go
clean:
rm -f bin/*