-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (53 loc) · 1.81 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
63
64
65
66
67
SHELL = /bin/sh
RM ?= rm -f
## Output
SERVER_NAME = server
CLIENT_NAME = client
BUILD_DIR = build
DOC_DIR = Documentation
## Rules ##
.PHONY: all
all:
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && conan install .. --build=missing \
&& cmake -DCMAKE_BUILD_TYPE=Release .. -G "Unix Makefiles" && cmake --build .
cp ${BUILD_DIR}/bin/r-type_client . && mv ${BUILD_DIR}/bin/r-type_server .
mkdir -p lib && cp ${BUILD_DIR}/lib/libGeldMonsterEntity.so ./lib && cp ${BUILD_DIR}/lib/libAccordeonMonsterEntity.so ./lib && cp ${BUILD_DIR}/lib/libCheetahMonsterEntity.so ./lib
.PHONY: debug
debug:
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && conan install .. --build=missing\
&& cmake -DCMAKE_BUILD_TYPE=Debug .. -G "Unix Makefiles" && cmake --build .
cp ${BUILD_DIR}/bin/r-type_client . && mv ${BUILD_DIR}/bin/r-type_server .
mkdir -p lib && cp ${BUILD_DIR}/lib/libGeldMonsterEntity.so ./lib && cp ${BUILD_DIR}/lib/libAccordeonMonsterEntity.so ./lib && cp ${BUILD_DIR}/lib/libCheetahMonsterEntity.so ./lib
# Clean build
.PHONY: clean
clean:
$(RM) -r $(BUILD_DIR)
.PHONY: doc-clean
doc-clean:
$(RM) -r $(DOC_DIR)/html/
$(RM) -r $(DOC_DIR)/latex/
$(RM) $(DOC_DIR)/refman.pdf
# Clean build and binaries
.PHONY: fclean
fclean: clean doc-clean
.PHONY: re
re: fclean all
.PHONY: tests_build
tests_build:
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && conan install .. --build=missing \
&& cmake -DCMAKE_BUILD_TYPE=Release -DUNIT_TESTS=TRUE .. -G "Unix Makefiles" && cmake --build .
.PHONY: tests_run
tests_run: tests_build
$(BUILD_DIR)/bin/unit_tests
.PHONY: doc
doc:
doxygen $(DOC_DIR)/Doxyfile
# Generate PDF documentation
.PHONY: doc_pdf
doc-pdf: doc
make -C $(DOC_DIR)/latex/
cp $(DOC_DIR)/latex/refman.pdf $(DOC_DIR)
# Launch doxygen in firefox browser
.PHONY: doc-firefox
doc-firefox: doc
firefox $(DOC_DIR)/html/index.html