Makefile
2.51 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
all: gen game
IMGTIME := $(shell date "+%G%m%d_%H%M%S")
pname = plugin-$(IMGTIME)
race = -race
#DEBUG = -gcflags "-l -N"
DEBUG=
# excel generator config
WORKSPACE=.
GEN_CLIENT=${WORKSPACE}/luban_examples/Tools/Luban.Client/Luban.Client.dll
CONF_ROOT=${WORKSPACE}/DesignerConfigs
# deploy
DEPLOYIP=192.168.0.100
DEPLOYNAME=zhaolu
DEPLOYPASSWD=zhaolu
DEPLOYDIR=/Users/zhaolu/Documents/pro2d
test:
go run cmd/test/main.go
http:
go run $(race) cmd/httpserver/main.go
game:
go run -race cmd/gameserver/*.go
build:
go build $(race) -o bin/account cmd/http.go
go build $(race) -o bin/game cmd/gameserver/*.go
go build $(race) -o bin/test cmd/test/client.go
regame:plugin
lsof -i:8850 | grep "agent" | grep -v grep | awk '{print $$2}' | xargs -I {} kill -USR1 {}
plugin:
cd bin && rm -rf ./plugin*.so && cd -
go build $(race) $(DEBUG) --buildmode=plugin -o bin/$(pname).so cmd/gameserver/plugin/*.go #--ldflags="-pluginpath=$(pname)"
cd bin && ln -s $(pname).so plugin.so && cd -
doc:
godoc -http=:8980 -goroot="." -play
open localhost:8980/pkg/pro2d/cmd/gameserver/action/#pkg-index
proto:
protoc -I./protos --go_out=./protos --go-grpc_out=./protos ./protos/*proto
protoc-go-inject-tag -input=./pb/*.pb.go
python tools/generator.py #python3
excel:
cd ${WORKSPACE}/DesignerConfigs && git pull && cd -
dotnet ${GEN_CLIENT} -h 127.0.0.1 -j cfg --\
-d ${CONF_ROOT}/Defines/__root__.xml \
--input_data_dir ${CONF_ROOT}/Datas \
--output_code_dir ${WORKSPACE}/csvdata/gen/cfg \
--output_data_dir ${WORKSPACE}/csvdata/data \
--gen_types code_go_bin,data_bin \
--go:bright_module_name "pro2d/csvdata/bin_bright" \
-s all
gen:proto excel
pull:
git submodule update --remote
docker-build:
# docker build -t my-tab -f /abc/defg/my-dockerfile /context-dir
docker build -t pro2d -f docker/Dockerfile ./ --force-rm
docker-save:
docker save pro2d > docker/pro2d.tar
docker-http:
docker rm -f http-pro2d
docker run --restart=always -d -p 8080:8080 --name http-pro2d pro2d ./http
docker-game:
docker rm -f game-pro2d
docker run --restart=always -d -p 8850:8850 --name game-pro2d pro2d ./game
deploy:
scp docker/* ${DEPLOYNAME}@${DEPLOYIP}:${DEPLOYDIR} #passwd: zhaolu
rm -f docker/pro2d.tar
ssh ${DEPLOYNAME}@${DEPLOYIP} "/Users/zhaolu/Documents/pro2d/restart.sh"
deploy-to: docker-build docker-save
scp docker/* ${DEPLOYNAME}@${DEPLOYIP}:${DEPLOYDIR} #passwd: zhaolu
rm -f docker/pro2d.tar
ssh ${DEPLOYNAME}@${DEPLOYIP} "${DEPLOYDIR}/restart.sh"
.PHONY: all build protos test cert plugin doc proto pull