2025-02-15 08:44:15 +01:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
#
|
|
|
|
# This file is part of libnvme.
|
|
|
|
# Copyright (c) 2021 Dell Inc.
|
|
|
|
#
|
|
|
|
# Authors: Martin Belanger <Martin.Belanger@dell.com>
|
|
|
|
#
|
|
|
|
NAME := libnvme
|
|
|
|
.DEFAULT_GOAL := ${NAME}
|
|
|
|
BUILD-DIR := .build
|
|
|
|
|
2025-03-20 08:08:33 +01:00
|
|
|
.PHONY: update-subprojects
|
|
|
|
update-subprojects:
|
|
|
|
meson subprojects update
|
|
|
|
|
2025-02-15 08:44:15 +01:00
|
|
|
${BUILD-DIR}:
|
2025-03-20 08:08:33 +01:00
|
|
|
meson setup $@
|
2025-02-15 08:44:15 +01:00
|
|
|
@echo "Configuration located in: $@"
|
|
|
|
@echo "-------------------------------------------------------"
|
|
|
|
|
|
|
|
.PHONY: ${NAME}
|
|
|
|
${NAME}: ${BUILD-DIR}
|
2025-03-20 08:08:33 +01:00
|
|
|
meson compile -C ${BUILD-DIR}
|
2025-02-15 08:44:15 +01:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
ifneq ("$(wildcard ${BUILD-DIR})","")
|
2025-03-20 08:08:33 +01:00
|
|
|
meson compile --clean -C ${BUILD-DIR}
|
2025-02-15 08:44:15 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: purge
|
|
|
|
purge:
|
|
|
|
ifneq ("$(wildcard ${BUILD-DIR})","")
|
|
|
|
rm -rf ${BUILD-DIR}
|
2025-03-20 08:08:33 +01:00
|
|
|
meson subprojects purge --confirm
|
2025-02-15 08:44:15 +01:00
|
|
|
endif
|
|
|
|
|
2025-03-20 08:08:33 +01:00
|
|
|
.PHONY: install
|
|
|
|
install: ${NAME}
|
|
|
|
meson install -C ${BUILD-DIR} --skip-subprojects
|
2025-02-15 08:44:15 +01:00
|
|
|
|
2025-02-16 10:05:45 +01:00
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
|
|
|
cd ${BUILD-DIR} && meson --internal uninstall
|
|
|
|
|
2025-03-20 08:08:33 +01:00
|
|
|
.PHONY: dist
|
|
|
|
dist: ${NAME}
|
|
|
|
meson dist -C ${BUILD-DIR} --formats gztar
|
|
|
|
|
2025-02-15 08:44:15 +01:00
|
|
|
.PHONY: test
|
2025-03-20 08:08:33 +01:00
|
|
|
test: ${NAME}
|
|
|
|
meson test -C ${BUILD-DIR}
|
|
|
|
|
|
|
|
# Test strictly libnvme (do not run tests on all the subprojects)
|
|
|
|
.PHONY: test-strict
|
|
|
|
test-strict: ${NAME}
|
|
|
|
meson test -C ${BUILD-DIR} --suite libnvme
|
2025-02-15 08:44:15 +01:00
|
|
|
|
|
|
|
.PHONY: rpm
|
2025-02-16 10:04:05 +01:00
|
|
|
rpm: ${BUILD-DIR}
|
|
|
|
git archive --format=tar HEAD > libnvme.tar
|
|
|
|
tar rf libnvme.tar ${BUILD-DIR}/libnvme.spec
|
|
|
|
gzip -f -9 libnvme.tar
|
|
|
|
rpmbuild -ta libnvme.tar.gz -v
|