-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (30 loc) · 958 Bytes
/
Makefile
File metadata and controls
41 lines (30 loc) · 958 Bytes
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
PREFIX = easyrest-
BINARIES = $(shell ls cmd)
SRC_DIR = ./cmd
BUILD_DIR ?= $(shell pwd)/bin
BIN_OUT = $(addprefix $(BUILD_DIR)/$(PREFIX), $(BINARIES))
COVERAGE ?= cover.out
export PATH := $(BUILD_DIR):$(PATH)
export CGO_ENABLED := 0
export ER_TOKEN_CACHE_TTL := 20
all: $(BIN_OUT)
$(BINARIES): %: $(BUILD_DIR)/$(PREFIX)%
$(BUILD_DIR)/$(PREFIX)%: $(SRC_DIR)/%/*.go
mkdir -p $(BUILD_DIR)
go build -o $@ $(SRC_DIR)/$*
clean:
rm -rf $(BUILD_DIR)
test: plugin-sqlite auth-jwt
go test -v -coverpkg=./... -coverprofile=$(COVERAGE) ./...
go tool cover -func=$(COVERAGE)
bench:
go test -cpuprofile cpu.prof -bench=. -benchmem ./tests/benchmark_test.go
run: plugin-sqlite auth-jwt
go run cmd/gateway/main.go --config test_config.yaml
multirun:
go run cmd/server/main.go --config test_config.yaml
run-perf: server
perf record -g ./bin/easyrest-server --config test_config.yaml
.PHONY: all clean test
update-packages:
go get -u ./... && go mod tidy