From: Kees Cook <keescook@chromium.org>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: shuah@kernel.org, mpe@ellerman.id.au,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: enforce local header dependency in lib.mk
Date: Wed, 25 Mar 2020 16:28:24 -0700 [thread overview]
Message-ID: <202003251627.91036FC@keescook> (raw)
In-Reply-To: <20200325231649.13049-1-skhan@linuxfoundation.org>
On Wed, Mar 25, 2020 at 05:16:49PM -0600, Shuah Khan wrote:
> Add local header dependency in lib.mk. This enforces the dependency
> blindly even when a test doesn't include the file, with the benefit
> of a simpler common logic without requiring individual tests to have
> special rule for it.
>
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
style nit below...
> ---
> tools/testing/selftests/lib.mk | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
> index 3ed0134a764d..b0556c752443 100644
> --- a/tools/testing/selftests/lib.mk
> +++ b/tools/testing/selftests/lib.mk
> @@ -137,7 +137,8 @@ endif
> # Selftest makefiles can override those targets by setting
> # OVERRIDE_TARGETS = 1.
> ifeq ($(OVERRIDE_TARGETS),)
> -$(OUTPUT)/%:%.c
> +LOCAL_HDRS := $(selfdir)/kselftest_harness.h $(selfdir)/kselftest.h
> +$(OUTPUT)/%:%.c $(LOCAL_HDRS)
> $(LINK.c) $^ $(LDLIBS) -o $@
It's already in lib.mk as "target:deps" but the tradition for kernel
make rules has been "target: deps". i.e.:
$(OUTPUT)/%: %.c $(LOCAL_HDRS)
But it doesn't actually matter. :)
-Kees
>
> $(OUTPUT)/%.o:%.S
> --
> 2.20.1
>
--
Kees Cook
prev parent reply other threads:[~2020-03-25 23:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 23:16 [PATCH] selftests: enforce local header dependency in lib.mk Shuah Khan
2020-03-25 23:28 ` Kees Cook [this message]
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=202003251627.91036FC@keescook \
--to=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.