-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (45 loc) · 1.15 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
61
62
CXX=clang++
CXXFLAGS=-std=c++2a -Wall -Wextra -pedantic -stdlib=libc++
# Define the target executable
TARGET=ipk24chat-client
# Define source files
SOURCES=$(wildcard src/*.cpp)
TEST_FLAGS=
ifeq ($(DEBUG), true)
TEST_FLAGS=-d
CXXFLAGS=-std=c++20 -Wall -Wextra -pedantic -g
endif
.PHONY: main run clean server docs diagrams zip
# Main target
main: $(SOURCES)
$(CXX) -I./include -o $(TARGET) $(SOURCES) $(CXXFLAGS)
# Run target
run-udp: main
@echo "\n=== Running the program ==="
@./$(TARGET) -t udp -s localhost
run-tcp: main
@echo "\n=== Running the program ==="
@./$(TARGET) -t tcp -s localhost
run-only-udp:
@./$(TARGET) -t udp -s localhost
run-only-tcp:
@./$(TARGET) -t tcp -s localhost
test:
python3 tests/testo.py ./$(TARGET) $(TEST_FLAGS)
test-tcp:
python3 tests/testo.py ./$(TARGET) $(TEST_FLAGS) -p tcp
test-udp:
python3 tests/testo.py ./$(TARGET) $(TEST_FLAGS) -p udp
docs:
doxygen Doxyfile
diagrams:
plantuml -tsvg -o ./ docs/*.puml'
zip:
zip -r xhobza03.zip src/ include/ Makefile README.md CHANGELOG.md LICENSE
# Clean target
clean:
rm -f $(TARGET)
rm -rf tmp/
# Server target
server:
nodemon --exec python3.11 python/server.py