On Fri, Nov 09, 2018 at 07:15:24AM -0800, Gwendal Grignou wrote: > Add rule to install to a target directory, /usr/local/blktests by > default. This seems reasonale, but I'm curious, what's your use case? > Signed-off-by: Gwendal Grignou <gwendal@xxxxxxxxxxxx> > --- > 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 should be added to the .PHONY targets. > + install -m755 -d $(dest) > + install check $(dest) > + cp -R tests common $(dest) > + $(MAKE) -C src dest=$(dest) install The src programs need to be installed to $(dest)/src. > # 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 $@ $^ This ability to install tests could also use a mention in the README.