-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (22 loc) · 823 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
EXECUTABLE=devscriber
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 build
test:
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)" ./...
$(LINUX):
env GOOS=linux GOARCH=amd64 go build ./... -v -o bin/$(LINUX) -ldflags="-s -w -X main.version=$(VERSION)" ./...
$(DARWIN):
env GOOS=darwin GOARCH=amd64 go build ./... -v -o bin/$(DARWIN) -ldflags="-s -w -X main.version=$(VERSION)" ./...
clean:
rm -f $(WINDOWS) $(LINUX) $(DARWIN)