@@ -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)/src install
+
# SC2119: "Use foo "$@" if function's $1 should mean script's $1". False
# positives on helpers like _init_scsi_debug.
SHELLCHECK_EXCLUDE := SC2119
@@ -13,4 +22,4 @@ check:
tests/*/rc tests/*/[0-9]*[0-9]
! grep TODO tests/*/rc tests/*/[0-9]*[0-9]
-.PHONY: all check
+.PHONY: all check install
@@ -22,6 +22,9 @@ Some tests require the following:
- multipath-tools (Debian, openSUSE) or device-mapper-multipath (Fedora)
- dmsetup (Debian) or device-mapper (Fedora, openSUSE, Arch Linux)
+Build blktests with `make install`. Optionally, install it to a known location
+with `make install`, `/usr/local/blktests` by default.
+
Add the list of block devices you want to test on in a file named `config`:
```sh
@@ -20,10 +20,14 @@ all: $(TARGETS)
clean:
rm -f $(TARGETS)
+install: $(TARGETS)
+ install -m755 -d $(dest)
+ install $(TARGETS) $(dest)
+
$(C_TARGETS): %: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^
$(CXX_TARGETS): %: %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^
-.PHONY: all clean
+.PHONY: all clean install
Add rule to install to a target directory, /usr/local/blktests by default. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> --- Makefile | 11 ++++++++++- README.md | 3 +++ src/Makefile | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-)