-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
49 lines (34 loc) · 1.19 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
45
46
47
48
49
.PHONY: run.docker run.local deps clean test build.docker build.local build.linux.armv8 build.linux.armv7 build.linux build.osx build.windows
ifneq ("$(wildcard .env)","")
ENV_FILE = .env
else
ENV_FILE = .env.example
endif
GOPKGS = $(shell go list ./... | grep -v /vendor/)
BIN_OUTPUT = bin/brcep
default: build.local
run.local: deps
go run $(GOPKGS) server.go
deps:
go mod vendor
run.docker: build.docker
docker run -p 127.0.0.1:8000:8000/tcp --env-file=${ENV_FILE} leogregianin/brcep
build.docker:
docker build -t="leogregianin/brcep" .
build.local:
GO111MODULE=on go build -o bin/brcep .
build.linux.armv8:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 GO111MODULE=on go build -o ${BIN_OUTPUT} .
build.linux.armv7:
GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 GO111MODULE=on go build -o ${BIN_OUTPUT} .
build.linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build -o ${BIN_OUTPUT} .
build.osx:
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build -o ${BIN_OUTPUT} .
build.windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build -o ${BIN_OUTPUT} .
test:
go test -v $(GOPKGS) -coverprofile=coverage.txt -covermode=atomic
clean:
rm -rf vendor
rm -rf bin