-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 821 Bytes
/
Copy pathMakefile
File metadata and controls
48 lines (36 loc) · 821 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
42
43
44
45
46
47
48
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
BINARY_NAME=be0
BINARY_UNIX=$(BINARY_NAME)_unix
# Build parameters
BUILD_DIR=build
MAIN_PATH=cmd/main.go
.PHONY: all build test clean run deps dev
all: test build
build:
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -v $(MAIN_PATH)
test:
$(GOTEST) -v ./...
clean:
rm -rf $(BUILD_DIR)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)
run:
nodemon -w . -e go,yaml,toml --exec "make build"
deps:
$(GOMOD) download
$(GOMOD) verify
docs:
@echo "Generating docs..."
@swag init -g internal/*
# Cross compilation
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BUILD_DIR)/$(BINARY_UNIX) -v $(MAIN_PATH)
dev:
nodemon
helper:
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_UNIX) -v cmd/helper/main.go