-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
73 lines (55 loc) · 1.89 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
69
70
71
72
ROOT:=$(shell pwd)
TEST_DIR=$(ROOT)/.test-output
.PHONY: test
test:
.PHONY: test_cmake
test: test_cmake
test_cmake: $(TEST_DIR)/cmake-scratch
.PHONY: test_cmake_add_subdir
test: test_cmake_add_subdir
test_cmake_add_subdir: $(TEST_DIR)/ciabatta-copy
$(TEST_DIR)/cmake-build: CMakeLists.txt test/CMakeLists.txt
rm -rf $(TEST_DIR)/cmake-build
mkdir -p $(TEST_DIR)/cmake-build
cd $(TEST_DIR)/cmake-build && \
cmake $(ROOT) -GNinja \
-DCMAKE_INSTALL_PREFIX="$(TEST_DIR)/cmake-install"
cd $(TEST_DIR)/cmake-build && ninja
cd $(TEST_DIR)/cmake-build/test && ctest .
$(TEST_DIR)/cmake-install: $(TEST_DIR)/cmake-build
rm -rf $(TEST_DIR)/cmake-install
mkdir -p $(TEST_DIR)/cmake-install
cd $(TEST_DIR)/cmake-build && ninja install
$(TEST_DIR)/cmake-scratch: $(TEST_DIR)/cmake-install
rm -rf $(TEST_DIR)/cmake-scratch
mkdir -p $(TEST_DIR)/cmake-scratch/
cp -r test/* $(TEST_DIR)/cmake-scratch/
mkdir -p $(TEST_DIR)/cmake-scratch/build
cd $(TEST_DIR)/cmake-scratch/build && \
cmake $(TEST_DIR)/cmake-scratch/ -GNinja \
-DCMAKE_PREFIX_PATH="$(TEST_DIR)/cmake-install" \
-DCMAKE_FIND_DEBUG_MODE=ON \
-DCIABATTA_TEST_FIND_PACKAGE=ON
cd $(TEST_DIR)/cmake-scratch/build && ninja && ninja test
$(TEST_DIR)/ciabatta-copy: CMakeLists.txt test/CMakeLists.txt
rm -rf $(TEST_DIR)/ciabatta-copy
mkdir -p $(TEST_DIR)/ciabatta-copy/thirdparty/ciabatta
mkdir -p $(TEST_DIR)/ciabatta-copy/build/
cp -r test/* $(TEST_DIR)/ciabatta-copy/
cp -r ./* $(TEST_DIR)/ciabatta-copy/thirdparty/ciabatta/
cd $(TEST_DIR)/ciabatta-copy/build && \
cmake $(TEST_DIR)/ciabatta-copy -GNinja \
-DCIABATTA_TEST_ADD_SUBDIRECTORY=ON \
-DCIABATTA_TEST_ADD_SUBDIRECTORY_PATH=thirdparty/ciabatta/
cd $(TEST_DIR)/ciabatta-copy/build && ninja
cd $(TEST_DIR)/ciabatta-copy/build && ctest .
.PHONY: test_bazel
test: test_bazel
test_bazel:
bazel build //...
bazel test //...
.PHONY: clean
clean:
rm -rf \
bazel-* \
$(TEST_DIR)