From f26f66d866ba1a9f3204e6fdfe2b07e67b5492ad Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 21:41:32 +0200 Subject: Adding upstream version 2.8. Signed-off-by: Daniel Baumann --- Makefile | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7f44364 --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of nvme. +# Copyright (c) 2021 Dell Inc. +# +# Authors: Martin Belanger +# +NAME := nvme +.DEFAULT_GOAL := ${NAME} +BUILD-DIR := .build + +${BUILD-DIR}: + meson $@ + @echo "Configuration located in: $@" + @echo "-------------------------------------------------------" + +.PHONY: ${NAME} +${NAME}: ${BUILD-DIR} + ninja -C ${BUILD-DIR} + +.PHONY: clean +clean: +ifneq ("$(wildcard ${BUILD-DIR})","") + ninja -C ${BUILD-DIR} -t $@ +endif + +.PHONY: purge +purge: +ifneq ("$(wildcard ${BUILD-DIR})","") + rm -rf ${BUILD-DIR} +endif + +.PHONY: install dist +install dist: ${BUILD-DIR} + cd ${BUILD-DIR} && meson $@ + +.PHONY: uninstall +uninstall: + cd ${BUILD-DIR} && meson --internal uninstall + +.PHONY: test +test: ${BUILD-DIR} + ninja -C ${BUILD-DIR} $@ + +.PHONY: rpm +rpm: + meson ${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 ${BUILD-DIR} --buildtype=debug + ninja -C ${BUILD-DIR} + +.PHONY: static +static: + meson ${BUILD-DIR} --buildtype=release \ + --default-library=static -Dc_link_args="-static" \ + --wrap-mode=forcefallback \ + -Dlibnvme:tests=false -Dlibnvme:keyutils=disabled + ninja -C ${BUILD-DIR} -- cgit v1.2.3