-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (57 loc) · 1.79 KB
/
Copy pathMakefile
File metadata and controls
68 lines (57 loc) · 1.79 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
##
## EPITECH PROJECT, 2024
## Zappy
## File description:
## This is the Makefile for the Zappy project
## Its goal is to call each CMake
##
.PHONY: all clean fclean re tests_run \
zappy_server zappy_ai zappy_gui
# Colors and formatting
GREEN = \033[1;32m
YELLOW = \033[1;33m
RED = \033[1;31m
BLUE = \033[1;36m
GOLD = \033[1;33m
MAGENTA = \033[1;35m
RESET = \033[0m
RUNNING = [$(YELLOW)~$(RESET)]
SUCCESS = [$(GREEN)✔$(RESET)]
FAILURE = [$(RED)✘$(RESET)]
SKIPPED = [$(MAGENTA)@$(RESET)]
all: zappy_server zappy_ai zappy_gui
@printf "$(SUCCESS)$(GREEN) 🎉 Zappy built successfully$(RESET)\n"
zappy_server:
@mkdir -p build
@cmake -S . -B build -DSERVER=ON -DGUI=OFF -DTESTS=ON
@cmake --build build --target zappy_server
@cp build/server/zappy_server .
@printf "$(SUCCESS)$(GREEN) 🚀 Zappy server built \
successfully$(RESET)\n"
zappy_ai:
@pip install -r robots/requirements.txt
@printf "#!$(shell which bash)\n\
$(shell which python3) robots/main.py \$$@" > zappy_ai
@chmod +x zappy_ai
@printf "$(SUCCESS)$(GREEN) 🤖 Zappy AI built successfully$(RESET)\n"
zappy_gui:
@mkdir -p build
@cmake -S . -B build -DGUI=ON -DSERVER=OFF
@cmake --build build --target zappy_gui
@cp build/gui/zappy_gui .
@printf "$(SUCCESS)$(GREEN) 🎨 Zappy GUI built successfully$(RESET)\n"
clean:
@rm -rf build
@printf "$(SUCCESS)$(GREEN) 🧹 Cleaned successfully$(RESET)\n"
fclean: clean
@rm -f zappy_server zappy_ai zappy_gui
@printf "$(SUCCESS)$(GREEN) 🔥 Binaries removed successfully$(RESET)\n"
re: fclean all
tests_run: fclean
@mkdir -p build
@cmake -S . -B build -DTESTS=ON -DSERVER=ON -DGUI=ON
@cmake --build build --target zappy_tests
@./build/tests/zappy_tests --gtest_output=xml
@mkdir -p build/robots
@pip install -r robots/requirements.txt
@python3 -m pytest --junitxml ai.xml