-
Notifications
You must be signed in to change notification settings - Fork 77
/
Makefile
41 lines (34 loc) · 868 Bytes
/
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
CLANG_FORMAT := clang-format
ALL_SRCS := $(shell \
find . -type f \
\( -path './build/*' -o -path './include/vendor/*' -o -path './vcpkg/*' \) \
-prune -o \
\( -name '*.cpp' -o -name '*.h' \) \
-print \
)
ALL_LISTFILES := $(shell \
find . -type f \
-path './build/*' \
-prune -o \
\( -name 'CMakeLists.txt' -o -name '*.cmake' \) \
-print \
)
VERSION := $(shell cat VERSION)
.PHONY: all
all:
echo "This is not a build system! Run my targets individually!"
.PHONY: format
format: clang-format cmake-format
.PHONY: clang-format
clang-format:
$(CLANG_FORMAT) -i -style=file $(ALL_SRCS)
git diff --exit-code
.PHONY: cmake-format
cmake-format:
cmake-format -i $(ALL_LISTFILES)
git diff --exit-code
.PHONY: doc
doc:
# Docs only: append the short hash to the version.
VERSION=$(VERSION)-$(shell git rev-parse --short HEAD) \
doxygen Doxyfile