-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (46 loc) · 1.37 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
BUILD_DIR := build
SRC_DIR := src
INC_DIR := include
TEST_DIR := unit_test
STANDALONE_DIR := standalone
RISCV_SYSROOT ?= $(PWD)/../sysroot
JOBS ?= 8
.PHONY: all
all: init format test test-e2e
.PHONY: init
init:
git submodule update --init --recursive
.PHONY: format
.SILENT: format
format:
./tools/clang-format.sh $(PWD)/$(SRC_DIR)
./tools/clang-format.sh $(PWD)/$(INC_DIR)
./tools/clang-format.sh $(PWD)/$(TEST_DIR)
./tools/clang-format.sh $(PWD)/$(STANDALONE_DIR)
.PHONY: build
build:
cmake -S $(PWD) -B $(PWD)/$(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release
cmake --build $(PWD)/$(BUILD_DIR) --parallel $(JOBS)
.PHONY: build-val
build-val:
cmake -S $(PWD) -B $(PWD)/$(BUILD_DIR) -DBESM666_TEST_WITH_VALGRIND=ON
cmake --build $(PWD)/$(BUILD_DIR) --parallel $(JOBS)
.PHONY: build-e2e
build-e2e:
cmake -S $(PWD) -B $(PWD)/$(BUILD_DIR) -DBESM666_WITH_E2E_TESTS=ON \
-DBESM666_RISCV_SYSROOT=$(RISCV_SYSROOT)
cmake --build $(PWD)/$(BUILD_DIR) --parallel $(JOBS)
.PHONY: test
test: build
ctest --test-dir $(PWD)/$(BUILD_DIR)/besm-666 --parallel $(JOBS) --output-on-failure
.PHONY: test-val
test-val: build-val
ctest --test-dir $(PWD)/$(BUILD_DIR)/besm-666 --parallel $(JOBS) --output-on-failure
.PHONY: test-e2e
test-e2e: build-e2e
ctest --test-dir $(PWD)/$(BUILD_DIR)/e2e --output-on-failure
.PHONY: clean
.SILENT: clean
clean:
rm -rf $(PWD)/$(BUILD_DIR)
rm -rf $(PWD)/include/autogen