-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (41 loc) · 1.25 KB
/
Copy pathMakefile
File metadata and controls
58 lines (41 loc) · 1.25 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
BIN := bin/blx
PKG := ./...
VERSION ?= dev
LDFLAGS := -s -w -X main.version=$(VERSION)
BIN_WIN := bin/blx.exe
WINVER ?= 0.2.0
WINRES := $(shell go env GOPATH)/bin/go-winres
WINRES_JSON := winres/winres.json
.PHONY: all build build-windows winres build-icon build-installer apk run test test-race vet fmt clean
all: build
build:
go build -trimpath -ldflags "$(LDFLAGS)" -o $(BIN) ./cmd/server
$(WINRES):
go install github.com/tc-hib/go-winres@v0.3.3
winres: $(WINRES)
$(WINRES) make --in $(WINRES_JSON) --out cmd/server/rsrc --arch amd64 \
--product-version=$(WINVER) --file-version=$(WINVER)
build-windows: winres
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BIN_WIN) ./cmd/server
build-icon:
$(RM) cmd/server/rsrc_windows_*.syso
go run ./cmd/genicon
$(WINRES) make --in $(WINRES_JSON) --out cmd/server/rsrc --arch amd64 \
--product-version=$(WINVER) --file-version=$(WINVER)
build-installer: build-windows
wine "C:/Program Files/Inno Setup 7/ISCC.exe" /F"BLX-Setup" installer.iss
apk:
./android/build-apk.sh
run: build
PORT=8080 $(BIN)
test:
go test $(PKG) -count=1
test-race:
go test $(PKG) -count=1 -race
vet:
go vet $(PKG)
fmt:
gofmt -w .
clean:
rm -rf bin
rm -f cmd/server/rsrc_windows_*.syso