This repository was archived by the owner on Aug 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (67 loc) · 2.18 KB
/
Makefile
File metadata and controls
88 lines (67 loc) · 2.18 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
86
87
88
# Variables
PLAYER1_ID := 1
PLAYER2_ID := 2
# Folders
MARTIN := bot/martin
GRIDMASTER := bot/gridmaster
# -------------------- Run targets --------------------
all: build
re: fclean all
ren: fclean run
bot: run
start: run
run: stop build
./core/core ./config.server.json $(PLAYER1_ID) $(PLAYER2_ID) > /dev/null &
$(GRIDMASTER)/gridmaster $(PLAYER1_ID) > /dev/null &
$(MARTIN)/martin $(PLAYER2_ID)
battle: stop build
chmod +x ./bot1
chmod +x ./bot2
./core/core ./config.server.json $(PLAYER1_ID) $(PLAYER2_ID) > /dev/null & &&
./bot2 $(PLAYER1_ID) > /dev/null &
$(MARTIN)/martin $(PLAYER2_ID)
debug: stop build
$(GRIDMASTER)/gridmaster $(PLAYER1_ID) &
$(MARTIN)/martin $(PLAYER2_ID) &
./core/core ./config.server.json $(PLAYER1_ID) $(PLAYER2_ID)
rebug: fclean debug # re but for debug
stop:
@pkill game > /dev/null || true &
@pkill martin > /dev/null || true &
@pkill gridmaster > /dev/null || true
# -------------------- Build targets --------------------
build: game_build martin_build gridmaster_build
game_build:
make -C core
martin_build:
make -C $(MARTIN)
gridmaster_build:
make -C $(GRIDMASTER)
# -------------------- Clean targets --------------------
clean: stop
make -C $(MARTIN) clean
make -C $(GRIDMASTER) clean
make -C core clean
fclean: clean
make -C $(MARTIN) fclean
make -C $(GRIDMASTER) fclean
make -C core fclean
# -------------------- Visualizers --------------------
start-visualizers:
cd 3d-visualizer && npm i && npm run dev &
cd debug-visualizer && npm i && npm run dev &
echo "Visualizers started. You can access them at http://localhost:8080 and http://localhost:5173 respectively."
echo "DO NOT CLOSE THIS TERMINAL or the visualizers will stop working."
# -------------------- Update Repo from Github --------------------
update:
git pull origin dev
git submodule update --init --recursive
git -C core checkout dev
git -C core pull
git -C bot/connection checkout dev
git -C bot/connection pull
git -C 3d-visualizer checkout main
git -C 3d-visualizer pull
git -C debug-visualizer checkout dev
git -C debug-visualizer pull
.PHONY: all re bot start run ren battle debug rebug stop build game_build martin_build gridmaster_build clean fclean update