forked from OpenChannelSSD/liblightnvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (68 loc) · 1.64 KB
/
Copy pathMakefile
File metadata and controls
95 lines (68 loc) · 1.64 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
BUILD_TYPE?=Release
BUILD_DIR?=build
BUILD_TESTS?=ON
BUILD_EXAMPLES?=ON
#
# Traditional build commands
#
default: configure make
debug:
$(eval BUILD_TYPE := Debug)
tests_off:
$(eval BUILD_TESTS := OFF)
examples_off:
$(eval BUILD_EXAMPLES := OFF)
cmake_check:
@cmake --version || (echo "\n** Please install 'cmake' **\n" && exit 1)
configure: cmake_check
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DTESTS=$(BUILD_TESTS) -DEXAMPLES=$(BUILD_EXAMPLES) ../
@echo "Modify build configuration in '$(BUILD_DIR)'"
make:
cd $(BUILD_DIR) && make
install:
cd $(BUILD_DIR) && make install
clean:
rm -r $(BUILD_DIR) || true
rm tags || true
all: clean default install
#
# Packages (currently debian/.deb)
#
pkg:
cd $(BUILD_DIR) && make package
pkg_install:
sudo dpkg -i $(BUILD_DIR)/*.deb
pkg_uninstall:
sudo apt-get --yes remove liblightnvm || true
#
# Commands useful for development
#
#
tags:
ctags * -R .
cscope -b `find . -name '*.c'` `find . -name '*.h'`
# Invoking tests ...
test_dev:
sudo nvm_test_dev nvme0n1
test_mbad:
sudo nvm_test_mbad nvme0n1
test_vblk:
sudo nvm_test_vblk nvme0n1
test_vblk_gp_n:
sudo nvm_test_vblk_gp_n nvme0n1
test_concur:
sudo nvm_test_concur nvme0n1
# ... all of them
test: test_dev test_vblk test_vblk_gp_n test_concur
# Invoking examples ...
ex_info:
@sudo nvm_ex_info nvme0n1 || true
ex_vblock_pio_1:
@sudo nvm_ex_vblock_pio_1 nvme0n1 || true
ex_vblock_pio_n:
@sudo nvm_ex_vblock_pio_n nvme0n1 || true
example: ex_info ex_vblock_pio_1 ex_vblock_pio_n
# ... all of them
# Removes everything, build and install package
dev: pkg_uninstall clean configure make pkg pkg_install