-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (43 loc) · 1.25 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
## VAR
NAME = zia
TESTS_NAME = unit_tests
BUILD_DIR = build
DOC_DIR = Documentation
SHELL = /bin/sh
RM ?= rm -f
## 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 .
.PHONY: debug
debug:
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && conan install .. --build=missing && cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" .. && cmake --build .
.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: doc-clean
cmake --build $(BUILD_DIR) --target 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
./${TESTS_NAME}
.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