-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
50 lines (50 loc) · 1.35 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
NAME := oauth2
all: # 构建
make clear
build:
make clear
./tools/gormt.exe -o internal/model
go build -o $(NAME) main.go
./$(NAME) debug
run:
# make clear
# ./tools/gormt -o internal/model
go build -o $(NAME) *.go
./$(NAME) debug
windows:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o $(NAME).exe main.go
mac:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o $(NAME) main.go
linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(NAME) main.go
clear:
test ! -d internal/model/ || rm -rf internal/model/*
test ! -d err/ || rm -rf err/
test ! -f $(NAME) || rm $(NAME)
test ! -f $(NAME).exe || rm $(NAME).exe
rm -rf ./prc/$(NAME)/*.go
# gen:
# - mkdir ../rpc
# - mkdir ./rpc/$(+)
# test -L rpc || ln -s ../rpc ./
# protoc --proto_path="../apidoc/proto/$(SaverName)/" --gmsec_out=plugins=gmsec:./rpc/$(SaverName) hello.proto
gen:
ifeq ($(LANG),) # windows
# test ! -d rpc/ || rm -rf rpc/
# test -h rpc || ln -s ../rpc ./
else
# test -h rpc || ln -s ../rpc ./ # with linux/mac
test -d rpc || ln -s ../rpc ./
endif
go generate
orm: # gormt 生成 orm代码
./tools/gormt.exe -o internal/model
install:
../proto_install.sh
source_install:
../proto_install.sh
master:
go get -u github.com/xxjwxc/public@master
go get -u github.com/xxjwxc/ginrpc@master
go get -u github.com/gmsec/micro@master
go get -u github.com/gmsec/goplugins@master