From e9e2d6fd230995222449539058bb0a4a203ce127 Mon Sep 17 00:00:00 2001 From: Lance Hartmann Date: Thu, 18 Oct 2018 14:48:49 -0400 Subject: [PATCH] build: Install targets for nvme perf and identify Introduces new macro INSTALL_EXAMPLE and two example apps, examples/nvme/perf and example/nvme/identify that make use of it to install them while at the same time renaming them in the target directory based on the source directory path relative to examples. Change-Id: I2d850458bb2589f80e0af6fb7a9d00aa3bbc6907 Signed-off-by: Lance Hartmann Reviewed-on: https://review.gerrithub.io/429963 (master) Reviewed-on: https://review.gerrithub.io/435696 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- examples/nvme/identify/Makefile | 3 +++ examples/nvme/perf/Makefile | 3 +++ mk/spdk.common.mk | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/examples/nvme/identify/Makefile b/examples/nvme/identify/Makefile index 0aa5e52b8..efd63aa7d 100644 --- a/examples/nvme/identify/Makefile +++ b/examples/nvme/identify/Makefile @@ -36,4 +36,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk APP = identify +install: $(APP) + $(INSTALL_EXAMPLE) + include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk diff --git a/examples/nvme/perf/Makefile b/examples/nvme/perf/Makefile index 573f56a03..bfdd0de99 100644 --- a/examples/nvme/perf/Makefile +++ b/examples/nvme/perf/Makefile @@ -41,4 +41,7 @@ SYS_LIBS += -laio CFLAGS += -DHAVE_LIBAIO endif +install: $(APP) + $(INSTALL_EXAMPLE) + include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index b00e8edc2..ca11c49ab 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -287,6 +287,11 @@ INSTALL_APP=\ install -d -m 755 "$(DESTDIR)$(bindir)"; \ install -m 755 "$(APP)" "$(DESTDIR)$(bindir)/" +INSTALL_EXAMPLE=\ + $(Q)echo " INSTALL $(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \ + install -d -m 755 "$(DESTDIR)$(bindir)"; \ + install -m 755 "$(APP)" "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))" + # Install a header INSTALL_HEADER=\ $(Q)echo " INSTALL $@"; \