linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
To: Bamvor Zhang Jian
	<bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-api <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org,
	Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Tyler Baker <tyler.baker-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 1/3] selftests/capabilities: align the usage of CFLAGS with others
Date: Mon, 16 Nov 2015 20:00:45 +1100	[thread overview]
Message-ID: <1447664445.2191.1.camel@ellerman.id.au> (raw)
In-Reply-To: <CAFy1USTzsUcmwoS3Y4LRQjQykK2CSMKZ7JEDX517x6R3u801cw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, 2015-11-16 at 16:52 +0800, Bamvor Zhang Jian wrote:
> Hi, Michael
> On 11/16/2015 01:16 PM, Michael Ellerman wrote:
> > On Sat, 2015-11-14 at 14:01 +0800, Bamvor Jian Zhang wrote:
> > > User need to provide cap-ng.h and libcap-ng.so for cross compiling
> > > which could be done by pass extra cflags to EXTRA_CLAGS. But other
> > > testcases pass CFLAGS instead.
> > > 
> > > Change CLAGS ':=' to CLAGS '+=' to align with others. Delete useless
> > > EXTRA_CLAGS at the same time.
> > 
> > Actually I think you can clean this up even more. I don't see any reason it
> > can't use the implicit rule for compilation.

> Yes, and with your comment in 2/3, how about this one:

Yeah that's fine. You have to say ${TEST_FILES} ${TEST_PROGS} twice, but that's
not so bad.

I think it's more common to use $( ) brackets in Makefiles, so I'd prefer you
used that rather than ${ }.

cheers

> diff --git a/tools/testing/selftests/capabilities/Makefile
> b/tools/testing/selftests/capabilities/Makefile
> index 8c8f0c1..de07767 100644
> --- a/tools/testing/selftests/capabilities/Makefile
> +++ b/tools/testing/selftests/capabilities/Makefile
> @@ -1,18 +1,13 @@
> -all:
> -
> -include ../lib.mk
> -
> -.PHONY: all clean
> -
> -TARGETS := validate_cap test_execve
> +TEST_FILES := validate_cap
>  TEST_PROGS := test_execve
> 
> -CFLAGS := -O2 -g -std=gnu99 -Wall -lcap-ng
> +CFLAGS += -O2 -g -std=gnu99 -Wall
> +LDLIBS += -lcap-ng -lrt -ldl
> 
> -all: $(TARGETS)
> +all: ${TEST_PROGS} ${TEST_FILES}
> 
>  clean:
> - $(RM) $(TARGETS)
> + ${RM} ${TEST_PROGS} ${TEST_FILES}
> +
> +include ../lib.mk
> 
> -$(TARGETS): %: %.c
> - $(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
> --
> To unsubscribe from this list: send the line "unsubscribe linux-api" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  parent reply	other threads:[~2015-11-16  9:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-14  6:01 [PATCH 0/3] Enable two testcases in kselftest Bamvor Jian Zhang
     [not found] ` <1447480914-14834-1-git-send-email-bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-11-14  6:01   ` [PATCH 1/3] selftests/capabilities: align the usage of CFLAGS with others Bamvor Jian Zhang
     [not found]     ` <1447480914-14834-2-git-send-email-bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-11-16  5:16       ` Michael Ellerman
     [not found]         ` <1447650976.959.5.camel-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
2015-11-16  8:52           ` Bamvor Zhang Jian
     [not found]             ` <CAFy1USTzsUcmwoS3Y4LRQjQykK2CSMKZ7JEDX517x6R3u801cw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-16  9:00               ` Michael Ellerman [this message]
2015-11-14  6:01   ` [PATCH 2/3] selftests/capabilities: actually test it Bamvor Jian Zhang
     [not found]     ` <1447480914-14834-3-git-send-email-bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-11-16  5:18       ` Michael Ellerman
     [not found]         ` <1447651093.959.7.camel-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
2015-11-16 18:49           ` Andy Lutomirski
     [not found]             ` <CALCETrWOP=4pJrnJsfW2zVWvGHNnZDC5HYy5tOop8W-X4U2H8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-16 18:56               ` Andy Lutomirski
2015-11-14  6:01   ` [PATCH 3/3] selftest/ipc: " Bamvor Jian Zhang

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=1447664445.2191.1.camel@ellerman.id.au \
    --to=mpe-gsx/oe8hsfggbc27wqdahg@public.gmane.org \
    --cc=bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
    --cc=tyler.baker-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).