Skip to content

Commit 5d8cc1b

Browse files
Martin Belangerigaw
authored andcommitted
Makefile: Add new targets and update meson command syntax
- For the "install" target, use "--skip-subprojects" so that only libnvme (and not the subprojects) get installed. - For the "purge" target, add "meson subprojects purge". - Added "update-subprojects" target - Added "test-strict" target. This is to limit testing to libnvme and not all the subprojects. Signed-off-by: Martin Belanger <[email protected]>
1 parent 0d8d0a5 commit 5d8cc1b

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

Makefile

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,52 @@ NAME := libnvme
99
.DEFAULT_GOAL := ${NAME}
1010
BUILD-DIR := .build
1111

12+
.PHONY: update-subprojects
13+
update-subprojects:
14+
meson subprojects update
15+
1216
${BUILD-DIR}:
13-
meson $@
17+
meson setup $@
1418
@echo "Configuration located in: $@"
1519
@echo "-------------------------------------------------------"
1620

1721
.PHONY: ${NAME}
1822
${NAME}: ${BUILD-DIR}
19-
ninja -C ${BUILD-DIR}
23+
meson compile -C ${BUILD-DIR}
2024

2125
.PHONY: clean
2226
clean:
2327
ifneq ("$(wildcard ${BUILD-DIR})","")
24-
ninja -C ${BUILD-DIR} -t $@
28+
meson compile --clean -C ${BUILD-DIR}
2529
endif
2630

2731
.PHONY: purge
2832
purge:
2933
ifneq ("$(wildcard ${BUILD-DIR})","")
3034
rm -rf ${BUILD-DIR}
35+
meson subprojects purge --confirm
3136
endif
3237

33-
.PHONY: install dist
34-
install dist: ${BUILD-DIR}
35-
cd ${BUILD-DIR} && meson $@
38+
.PHONY: install
39+
install: ${NAME}
40+
meson install -C ${BUILD-DIR} --skip-subprojects
3641

3742
.PHONY: uninstall
3843
uninstall:
3944
cd ${BUILD-DIR} && meson --internal uninstall
4045

46+
.PHONY: dist
47+
dist: ${NAME}
48+
meson dist -C ${BUILD-DIR} --formats gztar
49+
4150
.PHONY: test
42-
test: ${BUILD-DIR}
43-
ninja -C ${BUILD-DIR} $@
51+
test: ${NAME}
52+
meson test -C ${BUILD-DIR}
53+
54+
# Test strictly libnvme (do not run tests on all the subprojects)
55+
.PHONY: test-strict
56+
test-strict: ${NAME}
57+
meson test -C ${BUILD-DIR} --suite libnvme
4458

4559
.PHONY: rpm
4660
rpm: ${BUILD-DIR}

0 commit comments

Comments
 (0)