-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (30 loc) · 1.02 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
cmd ?= RUN
args ?=
CLANG_FORMAT=clang-format -i
.PHONY: all
all: docker
cmake:
cmake -B build && cmake --build build
# TODO make a first run command? or if the cmd is provided to rebuild it
docker:
@docker build -t numero_uri --target ${cmd} .
-@docker run -v ${PWD}:/numero_uri -e in_args="${args}" \
--rm -it numero_uri
docker-run:
-@docker run -v ${PWD}:/numero_uri -e in_args="${args}" \
--rm -it numero_uri
docker-test:
@docker build -t numero_uri --target test .
-@docker run -v ${PWD}:/numero_uri --rm -it numero_uri
build:
cmake -B build && cmake --build build
test:
cmake -B build -DBUILD_TESTING=ON -DNUMERO_URI_BUILD_TESTS=ON \
&& cmake --build build \
&& ctest --test-dir build/tests --output-on-failure
clean:
rm -rf build
format:
@find lib/inc -iname "*.h" -or -iname "*.cpp" -or -iname "*.cc" | xargs ${CLANG_FORMAT}
@find lib/src -iname "*.h" -or -iname "*.cpp" -or -iname "*.cc" | xargs ${CLANG_FORMAT}
@find tests -iname "*.h" -or -iname "*.cpp" -or -iname "*.cc" | xargs ${CLANG_FORMAT}