forked from cisco/mlspp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (50 loc) · 1.94 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
64
65
66
67
68
# This is just a convenience Makefile to avoid having to remember
# all the CMake commands and their arguments.
# Set CMAKE_GENERATOR in the environment to select how you build, e.g.:
# CMAKE_GENERATOR=Ninja
BUILD_DIR=build
TEST_DIR=build/test
CLANG_FORMAT=clang-format -i
CLANG_TIDY=OFF
.PHONY: all dev test ctest dtest dbtest libs test-libs test-all everything ci clean cclean format
all: ${BUILD_DIR}
cmake --build ${BUILD_DIR} --target mlspp
${BUILD_DIR}: CMakeLists.txt test/CMakeLists.txt
cmake -B${BUILD_DIR} .
dev:
# Only enable testing, not clang-tidy/sanitizers; the latter make the build
# too slow, and we can run them in CI
cmake -B${BUILD_DIR} -DTESTING=ON -DCMAKE_BUILD_TYPE=Debug .
test: ${BUILD_DIR} test/*
cmake --build ${BUILD_DIR} --target mlspp_test
dtest: test
${TEST_DIR}/mlspp_test
dbtest: test
lldb ${TEST_DIR}/mlspp_test
ctest: test
cmake --build ${BUILD_DIR} --target test
libs: ${BUILD_DIR}
cmake --build ${BUILD_DIR} --target bytes
cmake --build ${BUILD_DIR} --target hpke
cmake --build ${BUILD_DIR} --target tls_syntax
cmake --build ${BUILD_DIR} --target mls_vectors
test-libs: ${BUILD_DIR}
cmake --build ${BUILD_DIR} --target lib/bytes/test
cmake --build ${BUILD_DIR} --target lib/hpke/test
cmake --build ${BUILD_DIR} --target lib/tls_syntax/test
cmake --build ${BUILD_DIR} --target lib/mls_vectors/test
test-all: test-libs ctest
everything: ${BUILD_DIR}
cmake --build ${BUILD_DIR}
ci:
cmake -B ${BUILD_DIR} -DTESTING=ON -DCLANG_TIDY=ON -DSANITIZERS=ON \
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="${VCPKG_TOOLCHAIN_FILE}" .
clean:
cmake --build ${BUILD_DIR} --target clean
cclean:
rm -rf ${BUILD_DIR}
format:
find include -iname "*.h" -or -iname "*.cpp" | xargs ${CLANG_FORMAT}
find src -iname "*.h" -or -iname "*.cpp" | xargs ${CLANG_FORMAT}
find test -iname "*.h" -or -iname "*.cpp" | xargs ${CLANG_FORMAT}
find lib -iname "*.h" -or -iname "*.cpp" | grep -v "test_vectors.cpp" | xargs ${CLANG_FORMAT}