-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (54 loc) · 1.17 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
.PHONY: cmake
cmake:
cmake -S . -B build
WIN_DIR = /Documents/code/roc-win64
FULL_WIN_DIR := $(join ${WIN_HOME_DIR}, $(WIN_DIR))
TOP_LEVEL = $(shell find . -maxdepth 1 -type f)
SRC_DIRS = cmake include src test
.PHONY: sync
sync:
@for ff in $(TOP_LEVEL) ; do \
rsync -ruvhP $$ff $(FULL_WIN_DIR) ; \
done
@for dd in $(SRC_DIRS) ; do \
rsync -ruvhP $$dd $(FULL_WIN_DIR) ; \
done
.PHONY: build
build:
@$(MAKE) --no-print-directory --directory build
.PHONY: test
test:
ifndef testregex
ctest --test-dir build/test --output-on-failure
else
ctest --test-dir build/test --output-on-failure -R $(testregex)
endif
SOURCES = $(shell find src/ -name '*.cpp')
HEADERS = $(shell find include/ -name '*.h')
.PHONY: fmt
fmt:
@for src in $(SOURCES) ; do \
echo "Formatting $$src..." ; \
clang-format -i "$$src" ; \
done
@for src in $(HEADERS) ; do \
echo "Formatting $$src..." ; \
clang-format -i "$$src" ; \
done
@echo "Done"
.PHONY: tidy
tidy:
@for src in $(HEADERS) ; \
do \
clang-tidy "$$src" ; \
done
@for src in $(SOURCES) ; \
do \
clang-tidy "$$src" ; \
done
@echo "Done"
.PHONY: cloc
cloc:
cloc src/ include/ test/
.PHONY: release
release: sync build test