-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (47 loc) · 1.32 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
56
57
58
59
60
GO111MODULE=on
filename = nsqproxy
nowDate = $(shell date +"%Y%m%d%H%M%S")
.PHONY: build
build:
@echo "Build..."
mkdir -p bin
CGO_ENABLED=0 go build -o bin/$(filename) cmd/nsqproxy.go
.PHONY: build-linux
build-linux:
@echo "Build for linux..."
mkdir -p bin
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/$(filename)-linux-$(nowDate) cmd/nsqproxy.go
.PHONY: build-all
build-all:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/$(filename)-linux-amd64-$(nowDate) cmd/nsqproxy.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/$(filename)-darwin-amd64-$(nowDate) cmd/nsqproxy.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/$(filename)-windows-amd64-$(nowDate) cmd/nsqproxy.go
.PHONY: clean
clean:
rm -rf bin/nsqproxy*
.PHONY: kill
kill:
-killall nsqproxy
.PHONY: test
test:
go test ./...
.PHONY: run
run: build kill
nohup ./bin/nsqproxy &
.PHONY: statik
statik:
go get github.com/rakyll/statik
go generate ./...
.PHONY: vue-install
vue-install:
cd web/vue-admin && npm install
.PHONY: vue-install-taobao
vue-install-taobao:
cd web/vue-admin && npm install --registry=https://registry.npm.taobao.org
.PHONY: vue-build
vue-build:
cd web/vue-admin && npm run build:prod
mkdir -p web/public && cp -r web/vue-admin/dist/* web/public/
.PHONY: vue-dev
vue-dev:
cd web/vue-admin && yarn run dev