-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (43 loc) · 1.42 KB
/
Copy pathMakefile
File metadata and controls
63 lines (43 loc) · 1.42 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
59
60
61
62
SHELL := /bin/bash
BIN := bin/monstermq-edge
PKG := ./cmd/monstermq-edge
VERSION := $(shell cat version.txt 2>/dev/null | tr -d '\n' | tr -d '\r')
LDFLAGS := -s -w -X monstermq.io/edge/internal/version.Version=$(VERSION)
GOFLAGS := -trimpath
.PHONY: build build-arm64 build-armv7 test test-race lint clean gen run deb-arm64 deb-armv7 deb-amd64 deb-all release publish
build:
@mkdir -p bin
CGO_ENABLED=0 go build $(GOFLAGS) -ldflags="$(LDFLAGS)" -o $(BIN) $(PKG)
build-arm64:
@mkdir -p bin
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(GOFLAGS) -ldflags="$(LDFLAGS)" -o bin/monstermq-edge-linux-arm64 $(PKG)
build-armv7:
@mkdir -p bin
GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 go build $(GOFLAGS) -ldflags="$(LDFLAGS)" -o bin/monstermq-edge-linux-armv7 $(PKG)
build-amd64:
@mkdir -p bin
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(GOFLAGS) -ldflags="$(LDFLAGS)" -o bin/monstermq-edge-linux-amd64 $(PKG)
build-all: build-amd64 build-arm64 build-armv7
deb-arm64:
./scripts/build-deb.sh --arch arm64
deb-armv7:
./scripts/build-deb.sh --arch armhf
deb-amd64:
./scripts/build-deb.sh --arch amd64
deb-all: deb-arm64 deb-armv7 deb-amd64
release:
./release.sh
publish:
./publish.sh
test:
go test ./... -count=1 -timeout 60s
test-race:
go test ./... -race -count=1 -timeout 120s
lint:
go vet ./...
clean:
rm -rf bin dist
gen:
go run github.com/99designs/gqlgen generate
run: build
$(BIN) -config config.yaml.example