-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (37 loc) · 1.24 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
GO = go
GO_FILES = $(shell find . -maxdepth 1 -type f -name '*.go')
FMT = $(GO)imports -w
LINT = $(GO)lint
TEST = $(GO) test
VET = $(GO) vet -composites=false
BUILD = $(GO) build
LIVE = gin run main.go
.PHONY: all test
build:
$(BUILD) -o court_herald
live:
env GIN_PORT=4000 BIN_APP_PORT=4444 $(LIVE)
fmt:
$(FMT) $(GO_FILES)
$(FMT) $(shell find models -maxdepth 1 -type f -name '*.go')
$(FMT) $(shell find utils -maxdepth 1 -type f -name '*.go')
$(FMT) $(shell find api -maxdepth 1 -type f -name '*.go')
$(FMT) $(shell find api/cms -maxdepth 1 -type f -name '*.go')
$(FMT) $(shell find api/auth -maxdepth 1 -type f -name '*.go')
lint:
$(VET) $(GO_FILES)
$(VET) $(shell find models -maxdepth 1 -type f -name '*.go')
$(VET) $(shell find utils -maxdepth 1 -type f -name '*.go')
$(VET) $(shell find api -maxdepth 1 -type f -name '*.go')
$(VET) $(shell find api/cms -maxdepth 1 -type f -name '*.go')
$(VET) $(shell find api/auth -maxdepth 1 -type f -name '*.go')
$(LINT) $(GO_FILES)
$(LINT) $(shell find api -maxdepth 1 -type f -name '*.go')
$(LINT) $(shell find api/cms -maxdepth 1 -type f -name '*.go')
$(LINT) $(shell find api/auth -maxdepth 1 -type f -name '*.go')
test:
$(TEST)
clean:
rm -f court_herald
rm -f log.json
all: fmt lint test build