Makefile 680 Bytes
Newer Older
Matteo's avatar
Matteo committed
1
UNAME := $(shell uname)
Matteo's avatar
Matteo committed
2
3
4
5
FORMATTER = clang-format
DOCS_GEN = doxygen
FORMAT_OPT = -i -style="{BasedOnStyle: google,IndentWidth: 4,ColumnLimit: 120}"
TARGET = video_analyser
Matteo's avatar
Matteo committed
6
7
8
9
10
11
12
13
14
15
16

ifeq ($(UNAME), Linux)
	OPEN = xdg-open
endif
ifeq ($(UNAME), Darwin)
	OPEN = open
endif
ifeq ($(UNAME), Windows)
	OPEN = start
endif

Matteo's avatar
Matteo committed
17
.PHONY: all clean test docs run build
Matteo's avatar
Matteo committed
18

Matteo's avatar
update  
Matteo committed
19
20
21
22
23
24
25
26
27
28
build:
	cmake -S . -B build
	cmake --build build

test:
	cd build && ctest

clean:
	rm -rf build
	rm -rf bin
Matteo's avatar
Matteo committed
29
30
	rm -rf docs/html
	rm -rf docs/latex
Matteo's avatar
update  
Matteo committed
31

Matteo's avatar
Matteo committed
32
33
34
format:
	$(FORMATTER) $(FORMAT_OPT) src/*.cpp src/*.h src/lib/*.cpp src/lib/*.h tests/*.cpp

Matteo's avatar
Matteo committed
35
docs:
Matteo's avatar
Matteo committed
36
	$(DOCS_GEN) docs/Doxyfile && $(OPEN) docs/html/index.html
Matteo's avatar
Matteo committed
37

Matteo's avatar
update  
Matteo committed
38
run:
Matteo's avatar
Matteo committed
39
	./bin/video_analyser