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
|
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of nvme.
# Copyright (c) 2021 Dell Inc.
#
# Authors: Martin Belanger <Martin.Belanger@dell.com>
#
NAME := nvme
.DEFAULT_GOAL := ${NAME}
BUILD-DIR := .build
.PHONY: update-subprojects
update-subprojects:
meson subprojects update
${BUILD-DIR}:
meson setup $@
@echo "Configuration located in: $@"
@echo "-------------------------------------------------------"
.PHONY: ${NAME}
${NAME}: ${BUILD-DIR}
meson compile -C ${BUILD-DIR}
.PHONY: clean
clean:
ifneq ("$(wildcard ${BUILD-DIR})","")
rm -rf ${BUILD-DIR}
meson subprojects purge --confirm
endif
.PHONY: purge
purge: clean
.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: ${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:
meson setup ${BUILD-DIR} \
-Dudevrulesdir=$(shell rpm --eval '%{_udevrulesdir}') \
-Dsystemddir=$(shell rpm --eval '%{_unitdir}') \
-Ddocs=man -Ddocs-build=true
rpmbuild -ba ${BUILD-DIR}/nvme.spec --define "_builddir ${BUILD-DIR}" -v
.PHONY: debug
debug:
meson setup ${BUILD-DIR} --buildtype=debug
meson compile -C ${BUILD-DIR}
.PHONY: static
static:
meson setup ${BUILD-DIR} --buildtype=release \
--wrap-mode=forcefallback \
--default-library=static \
--prefix=/usr \
-Dc_link_args="-static" \
-Dlibnvme:default_library=static \
-Dlibnvme:keyutils=disabled \
-Dlibnvme:liburing=disabled \
-Dlibnvme:python=disabled \
-Dlibnvme:openssl=disabled \
-Dlibnvme:tests=false \
-Dlibnvme:examples=false
meson compile -C ${BUILD-DIR}
|