From: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
To: Bamvor Jian Zhang
<bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org,
khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
tyler.baker-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
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 16:16:16 +1100 [thread overview]
Message-ID: <1447650976.959.5.camel@ellerman.id.au> (raw)
In-Reply-To: <1447480914-14834-2-git-send-email-bamvor.zhangjian-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
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.
Also libraries should be in LDLIBS, not CFLAGS. And we can change the ordering
so that we don't need to define all multiple times.
Can you test this works for you?
cheers
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
index 8c8f0c1f0889..5f690c1ae894 100644
--- a/tools/testing/selftests/capabilities/Makefile
+++ b/tools/testing/selftests/capabilities/Makefile
@@ -1,18 +1,14 @@
-all:
-
-include ../lib.mk
-
-.PHONY: all clean
-
TARGETS := validate_cap test_execve
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)
+include ../lib.mk
+
clean:
$(RM) $(TARGETS)
-$(TARGETS): %: %.c
- $(CC) -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl
+.PHONY: all clean
next prev parent reply other threads:[~2015-11-16 5:16 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 [this message]
[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
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=1447650976.959.5.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).