-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
46 lines (35 loc) · 969 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
34
35
36
37
38
39
40
41
42
43
44
45
46
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOCOVER=$(GOCMD) tool cover
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOFMT=gofmt
BINARY_NAME=eee-safe
GOFILES=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
.DEFAULT_GOAL := all
.PHONY: all build build-linux-amd64 coverage test check-fmt fmt clean run run-debug
all: check-fmt test coverage build
build:
mkdir -p ./out
$(GOBUILD) -o ./out/$(BINARY_NAME) -v ./cmd/eee-safe
build-linux-amd64:
mkdir -p ./out
GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./out/$(BINARY_NAME)_linux_amd64 -v ./cmd/eee-safe
coverage:
$(GOCOVER) -func=./out/coverage.out
test:
mkdir -p ./out
mkdir -p cmd/eee-safe/threema-backups
$(GOTEST) -v ./... -coverprofile=./out/coverage.out
check-fmt:
$(GOFMT) -d ${GOFILES}
fmt:
$(GOFMT) -w ${GOFILES}
clean:
$(GOCLEAN)
rm -rf ./out
run: build
./out/$(BINARY_NAME) -config=configs/config.yml
run-debug: build
./out/$(BINARY_NAME) -config=configs/config.yml -debug