public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: osandov@fb.com, linux-block@vger.kernel.org
Subject: Re: [PATCH blktests] makefile: Add install rule
Date: Wed, 14 Nov 2018 10:26:10 -0800	[thread overview]
Message-ID: <20181114182610.GB3253@vader> (raw)
In-Reply-To: <20181109151524.50405-1-gwendal@chromium.org>

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@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 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.

  reply	other threads:[~2018-11-14 18:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09 15:15 [PATCH blktests] makefile: Add install rule Gwendal Grignou
2018-11-14 18:26 ` Omar Sandoval [this message]
2018-11-14 19:37   ` Gwendal Grignou
2018-11-14 19:39     ` [PATCH v2] " Gwendal Grignou
2018-11-14 19:46       ` Omar Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181114182610.GB3253@vader \
    --to=osandov@osandov.com \
    --cc=gwendal@chromium.org \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox