]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Makefile: Add new targets and update meson command syntax
authorMartin Belanger <martin.belanger@dell.com>
Fri, 28 Feb 2025 16:06:23 +0000 (11:06 -0500)
committerDaniel Wagner <wagi@monom.org>
Wed, 5 Mar 2025 14:57:48 +0000 (15:57 +0100)
- For the "install" target, use "--skip-subprojects" so that only
  nvme-cli (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 nvme-cli
  and not all the subprojects.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Makefile

index 1838a0f43fac7dde76a30e422106471e9d087a6f..eb4283d2833e11306ed9c846cc8c3b1111fb93ae 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,10 @@ NAME          := nvme
 .DEFAULT_GOAL := ${NAME}
 BUILD-DIR     := .build
 
+.PHONY: update-subprojects
+update-subprojects:
+       meson subprojects update
+
 ${BUILD-DIR}:
        meson setup $@
        @echo "Configuration located in: $@"
@@ -28,19 +32,29 @@ endif
 purge:
 ifneq ("$(wildcard ${BUILD-DIR})","")
        rm -rf ${BUILD-DIR}
+       meson subprojects purge --confirm
 endif
 
-.PHONY: install dist
-install dist: ${BUILD-DIR}
-       cd ${BUILD-DIR} && meson $@
+.PHONY: install
+install: ${NAME}
+       meson install -C ${BUILD-DIR} --skip-subprojects
 
 .PHONY: uninstall
 uninstall:
        cd ${BUILD-DIR} && meson --internal uninstall
 
+.PHONY: dist
+dist: ${NAME}
+       meson dist -C ${BUILD-DIR} --formats gztar
+
 .PHONY: test
-test: ${BUILD-DIR}
-       ninja -C ${BUILD-DIR} $@
+test: ${NAME}
+       meson test -C ${BUILD-DIR}
+
+# Test strictly nvme-cli (do not run tests on all the subprojects)
+.PHONY: test-strict
+test-strict: ${NAME}
+       meson test -C ${BUILD-DIR} --suite nvme-cli
 
 .PHONY: rpm
 rpm: