-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·57 lines (47 loc) · 1.67 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
50
51
52
53
54
55
# Jupiter Golang Application Standard Makefile
SHELL:=/bin/bash
BASE_PATH:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
BUILD_PATH:=$(BASE_PATH)/build
TITLE:=$(shell basename $(BASE_PATH))
BUILD_TIME:=$(shell date +%Y-%m-%d--%T)
JUPITER:=github.com/douyu/jupiter
all:print fmt lint buildDemo
alltar:print fmt lint buildDemo
print:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making print<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@echo SHELL:$(SHELL)
@echo BASE_PATH:$(BASE_PATH)
@echo BUILD_PATH:$(BUILD_PATH)
@echo TITLE:$(TITLE)
@echo BUILD_TIME:$(BUILD_TIME)
@echo JUPITER:$(JUPITER)
@echo -e "\n"
fmt:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making fmt<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
go fmt $(TITLE)/internal/...
@echo -e "\n"
lint:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making lint<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
ifndef REVIVE
go get -u github.com/mgechev/revive
endif
revive -formatter stylish internal/...
@echo -e "\n"
errcheck:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making errcheck<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
ifndef ERRCHCEK
go get -u github.com/kisielk/errcheck
endif
@errcheck internal/...
@echo -e "\n"
test:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making test<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@echo testPath ${BAST_PATH}
go test -v .${BAST_PATH}/...
buildDemo:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making build<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
chmod +x $(BUILD_PATH)/script/shell/*.sh
$(BUILD_PATH)/script/shell/build.sh $(TITLE) $(JUPITER)/pkg $(BASE_PATH)/cmd/main.go
@echo -e "\n"
run:
go run cmd/main.go --config=config/config.toml