public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH blktests] makefile: Add install rule
@ 2018-11-09 15:15 Gwendal Grignou
  2018-11-14 18:26 ` Omar Sandoval
  0 siblings, 1 reply; 5+ messages in thread
From: Gwendal Grignou @ 2018-11-09 15:15 UTC (permalink / raw)
  To: osandov; +Cc: linux-block

Add rule to install to a target directory, /usr/local/blktests by
default.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
 Makefile     | 9 +++++++++
 src/Makefile | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/Makefile b/Makefile
index 38b8ad1..d7c2b74 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,18 @@
+prefix ?= /usr/local
+dest = $(DESTDIR)$(prefix)/blktests
+
 all:
 	$(MAKE) -C src all
 
 clean:
 	$(MAKE) -C src clean
 
+install:
+	install -m755 -d $(dest)
+	install check $(dest)
+	cp -R tests common $(dest)
+	$(MAKE) -C src dest=$(dest) install
+
 # SC2119: "Use foo "$@" if function's $1 should mean script's $1". False
 # positives on helpers like _init_scsi_debug.
 SHELLCHECK_EXCLUDE := SC2119
diff --git a/src/Makefile b/src/Makefile
index 15c1022..f0ddbb5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -20,6 +20,9 @@ all: $(TARGETS)
 clean:
 	rm -f $(TARGETS)
 
+install: $(TARGETS)
+	install $(TARGETS) $(dest)
+
 $(C_TARGETS): %: %.c
 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^
 
-- 
2.16.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-14 19:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-09 15:15 [PATCH blktests] makefile: Add install rule Gwendal Grignou
2018-11-14 18:26 ` Omar Sandoval
2018-11-14 19:37   ` Gwendal Grignou
2018-11-14 19:39     ` [PATCH v2] " Gwendal Grignou
2018-11-14 19:46       ` Omar Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox