-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
44 lines (32 loc) · 1.11 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
36
37
38
39
40
41
42
43
44
EXECUTABLE=tangalanga
BUILD_PATH=build
WINDOWS=$(EXECUTABLE)_windows_amd64.exe
LINUX=$(EXECUTABLE)_linux_amd64
DARWIN=$(EXECUTABLE)_darwin_amd64
VERSION=$(shell git describe --tags --always --long --dirty)
LDFLAGS=-s -w -X main.version=$(VERSION) -X main.baked=$(TOKEN)
.PHONY: all clean proto
all: build
windows: $(WINDOWS)
linux: $(LINUX)
darwin: $(DARWIN)
no:
unset -v TOKEN
proto:
protoc --go_out=proto meeting.proto
build: windows linux darwin
@echo version: $(VERSION)
$(WINDOWS):
env GOOS=windows GOARCH=amd64 go build -o $(BUILD_PATH)/$(WINDOWS) -ldflags="$(LDFLAGS)" .
@chmod +x $(BUILD_PATH)/$(WINDOWS)
zip -r $(BUILD_PATH)/$(WINDOWS).zip $(BUILD_PATH)/$(WINDOWS)
$(LINUX):
env GOOS=linux GOARCH=amd64 go build -o $(BUILD_PATH)/$(LINUX) -ldflags="$(LDFLAGS)" ./
@chmod +x $(BUILD_PATH)/$(LINUX)
tar cfz $(BUILD_PATH)/$(LINUX).tgz $(BUILD_PATH)/$(LINUX)
$(DARWIN):
env GOOS=darwin GOARCH=amd64 go build -o $(BUILD_PATH)/$(DARWIN) -ldflags="-s -w -X main.version=$(VERSION)" ./
@chmod +x $(BUILD_PATH)/$(DARWIN)
tar cfz $(BUILD_PATH)/$(DARWIN).tgz $(BUILD_PATH)/$(DARWIN)
clean:
rm -f $(BUILD_PATH)/*