From patchwork Fri Jul 31 12:15:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1339417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BJ5nb5B41z9s1x for ; Fri, 31 Jul 2020 22:14:57 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 1B77D3C28F7 for ; Fri, 31 Jul 2020 14:14:50 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) by picard.linux.it (Postfix) with ESMTP id A2A4F3C13DC for ; Fri, 31 Jul 2020 14:14:48 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 1933B20150A for ; Fri, 31 Jul 2020 14:14:48 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C55DDAF8E for ; Fri, 31 Jul 2020 12:15:00 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Fri, 31 Jul 2020 14:15:06 +0200 Message-Id: <20200731121508.12805-2-chrubis@suse.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200731121508.12805-1-chrubis@suse.cz> References: <20200731121508.12805-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH 1/3] build system: Add explicit make rules X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" This commit adds explicit build rules, the main motivation are recent build failures caused by library orderings. To fix that this commit introduces LTPLDLIBS special variable that is passed to linker before the LDLIBS which avoids the need for tricks as "LDLIBS := -lltpfoo $(LDLIBS)" in the Makefiles. This commit also silences the output by default a bit, the verbose output could be enabled by VERBOSE=1 env variable, which is probably what most of the build systems will do if this gets commited. I guess that we can as well silence a bit the "make entering/leaving directory" if this the right way to go. Signed-off-by: Cyril Hrubis --- include/mk/env_post.mk | 2 ++ include/mk/rules.mk | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 include/mk/rules.mk diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk index f4169ad66..bdf8c696d 100644 --- a/include/mk/env_post.mk +++ b/include/mk/env_post.mk @@ -107,4 +107,6 @@ $(error You must define $$(prefix) before executing install) endif # END $(filter-out install,$(MAKECMDGOALS)),$(MAKECMDGOALS) endif +include $(top_srcdir)/include/mk/rules.mk + endif diff --git a/include/mk/rules.mk b/include/mk/rules.mk new file mode 100644 index 000000000..e9b9c35ef --- /dev/null +++ b/include/mk/rules.mk @@ -0,0 +1,29 @@ +%.o: %.c +ifdef VERBOSE + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< +else + @$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + @echo CC $@ +endif + +ifdef VERBOSE +COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c +else +COMPILE.c=@echo CC $@; $(CC) $(CPPFLAGS) $(CFLAGS) -c +endif + +%: %.o +ifdef VERBOSE + $(CC) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@ +else + @$(CC) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@ + @echo LD $@ +endif + +%: %.c +ifdef VERBOSE + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@ +else + @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@ + @echo CC $@ +endif From patchwork Fri Jul 31 12:15:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1339419 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BJ5nq5znqz9s1x for ; Fri, 31 Jul 2020 22:15:11 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 11A5E3C4BB3 for ; Fri, 31 Jul 2020 14:15:09 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id 06AC93C13DC for ; Fri, 31 Jul 2020 14:14:48 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 7BA5C1003A65 for ; Fri, 31 Jul 2020 14:14:48 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 34678B188 for ; Fri, 31 Jul 2020 12:15:01 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Fri, 31 Jul 2020 14:15:07 +0200 Message-Id: <20200731121508.12805-3-chrubis@suse.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200731121508.12805-1-chrubis@suse.cz> References: <20200731121508.12805-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 2/3] testcases: Make use of LTPLDLIBS X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Cyril Hrubis --- testcases/kernel/syscalls/clock_gettime/Makefile | 2 +- testcases/kernel/syscalls/ipc/msgctl/Makefile | 2 +- testcases/kernel/syscalls/ipc/msgget/Makefile | 2 +- testcases/kernel/syscalls/ipc/msgrcv/Makefile | 2 +- testcases/kernel/syscalls/ipc/msgsnd/Makefile | 2 +- testcases/kernel/syscalls/ipc/msgstress/Makefile | 2 +- testcases/kernel/syscalls/ipc/semctl/Makefile | 4 ++-- testcases/kernel/syscalls/ipc/semget/Makefile | 2 +- testcases/kernel/syscalls/ipc/semop/Makefile | 2 +- testcases/kernel/syscalls/ipc/shmat/Makefile | 2 +- testcases/kernel/syscalls/ipc/shmctl/Makefile | 4 ++-- testcases/kernel/syscalls/ipc/shmdt/Makefile | 2 +- testcases/kernel/syscalls/ipc/shmget/Makefile | 2 +- testcases/kernel/syscalls/kill/Makefile | 4 ++-- testcases/kernel/syscalls/mbind/Makefile | 6 ++++-- testcases/kernel/syscalls/mremap/Makefile | 2 +- testcases/kernel/syscalls/rt_sigtimedwait/Makefile | 2 +- testcases/kernel/syscalls/set_mempolicy/Makefile | 3 ++- testcases/kernel/syscalls/sigtimedwait/Makefile | 2 +- testcases/kernel/syscalls/sigwait/Makefile | 2 +- testcases/kernel/syscalls/sigwaitinfo/Makefile | 2 +- 21 files changed, 28 insertions(+), 25 deletions(-) diff --git a/testcases/kernel/syscalls/clock_gettime/Makefile b/testcases/kernel/syscalls/clock_gettime/Makefile index 1c1cbd7a8..e7f5e9e75 100644 --- a/testcases/kernel/syscalls/clock_gettime/Makefile +++ b/testcases/kernel/syscalls/clock_gettime/Makefile @@ -8,6 +8,6 @@ LTPLIBS = ltpvdso include $(top_srcdir)/include/mk/testcases.mk LDLIBS+=-lrt -clock_gettime04: LDLIBS += -lltpvdso +clock_gettime04: LTPLDLIBS = -lltpvdso include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgctl/Makefile b/testcases/kernel/syscalls/ipc/msgctl/Makefile index a11cbcf2e..6b2b26d05 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/Makefile +++ b/testcases/kernel/syscalls/ipc/msgctl/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpnewipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpnewipc +LTPLDLIBS = -lltpnewipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgget/Makefile b/testcases/kernel/syscalls/ipc/msgget/Makefile index a11cbcf2e..6b2b26d05 100644 --- a/testcases/kernel/syscalls/ipc/msgget/Makefile +++ b/testcases/kernel/syscalls/ipc/msgget/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpnewipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpnewipc +LTPLDLIBS = -lltpnewipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgrcv/Makefile b/testcases/kernel/syscalls/ipc/msgrcv/Makefile index f62cd1f48..26b9f264d 100644 --- a/testcases/kernel/syscalls/ipc/msgrcv/Makefile +++ b/testcases/kernel/syscalls/ipc/msgrcv/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpipc +LTPLDLIBS = -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgsnd/Makefile b/testcases/kernel/syscalls/ipc/msgsnd/Makefile index 17960cae3..85017fe90 100644 --- a/testcases/kernel/syscalls/ipc/msgsnd/Makefile +++ b/testcases/kernel/syscalls/ipc/msgsnd/Makefile @@ -11,6 +11,6 @@ endif include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpnewipc +LTPLDLIBS += -lltpnewipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/msgstress/Makefile b/testcases/kernel/syscalls/ipc/msgstress/Makefile index f62cd1f48..b821bda01 100644 --- a/testcases/kernel/syscalls/ipc/msgstress/Makefile +++ b/testcases/kernel/syscalls/ipc/msgstress/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpipc +LTPLDLIBS += -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/semctl/Makefile b/testcases/kernel/syscalls/ipc/semctl/Makefile index 99971a7db..f711e7750 100644 --- a/testcases/kernel/syscalls/ipc/semctl/Makefile +++ b/testcases/kernel/syscalls/ipc/semctl/Makefile @@ -7,7 +7,7 @@ LTPLIBS = ltpipc ltpnewipc include $(top_srcdir)/include/mk/testcases.mk -semctl01 semctl02 semctl03 semctl04 semctl05 semctl06 semctl07: LDLIBS += -lltpipc -semctl08: LDLIBS += -lltpnewipc +semctl01 semctl02 semctl03 semctl04 semctl05 semctl06 semctl07: LTPLDLIBS = -lltpipc +semctl08: LTPLDLIBS = -lltpnewipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/semget/Makefile b/testcases/kernel/syscalls/ipc/semget/Makefile index f62cd1f48..26b9f264d 100644 --- a/testcases/kernel/syscalls/ipc/semget/Makefile +++ b/testcases/kernel/syscalls/ipc/semget/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpipc +LTPLDLIBS = -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/semop/Makefile b/testcases/kernel/syscalls/ipc/semop/Makefile index f62cd1f48..26b9f264d 100644 --- a/testcases/kernel/syscalls/ipc/semop/Makefile +++ b/testcases/kernel/syscalls/ipc/semop/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpipc +LTPLDLIBS = -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmat/Makefile b/testcases/kernel/syscalls/ipc/shmat/Makefile index a11cbcf2e..6b2b26d05 100644 --- a/testcases/kernel/syscalls/ipc/shmat/Makefile +++ b/testcases/kernel/syscalls/ipc/shmat/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpnewipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpnewipc +LTPLDLIBS = -lltpnewipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmctl/Makefile b/testcases/kernel/syscalls/ipc/shmctl/Makefile index 0172bb495..2e0ed0ceb 100644 --- a/testcases/kernel/syscalls/ipc/shmctl/Makefile +++ b/testcases/kernel/syscalls/ipc/shmctl/Makefile @@ -10,7 +10,7 @@ shmctl05: LDLIBS += -lrt include $(top_srcdir)/include/mk/testcases.mk -shmctl01 shmctl02 shmctl03 shmctl04 shmctl05: LDLIBS += -lltpipc -shmctl06: LDLIBS += -lltpnewipc +shmctl01 shmctl02 shmctl03 shmctl04 shmctl05: LTPLDLIBS = -lltpipc +shmctl06: LTPLDLIBS = -lltpnewipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmdt/Makefile b/testcases/kernel/syscalls/ipc/shmdt/Makefile index f62cd1f48..26b9f264d 100644 --- a/testcases/kernel/syscalls/ipc/shmdt/Makefile +++ b/testcases/kernel/syscalls/ipc/shmdt/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpipc +LTPLDLIBS = -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/ipc/shmget/Makefile b/testcases/kernel/syscalls/ipc/shmget/Makefile index f62cd1f48..26b9f264d 100644 --- a/testcases/kernel/syscalls/ipc/shmget/Makefile +++ b/testcases/kernel/syscalls/ipc/shmget/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpipc +LTPLDLIBS = -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/kill/Makefile b/testcases/kernel/syscalls/kill/Makefile index 00cadabef..3d1b1468a 100644 --- a/testcases/kernel/syscalls/kill/Makefile +++ b/testcases/kernel/syscalls/kill/Makefile @@ -7,7 +7,7 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -kill07: LDLIBS += -lltpipc -kill05: LDLIBS += -lltpipc +kill07: LTPLDLIBS = -lltpipc +kill05: LTPLDLIBS = -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mbind/Makefile b/testcases/kernel/syscalls/mbind/Makefile index 6d571271c..ed7d4375c 100644 --- a/testcases/kernel/syscalls/mbind/Makefile +++ b/testcases/kernel/syscalls/mbind/Makefile @@ -3,12 +3,14 @@ top_srcdir ?= ../../../.. +LTPLIBS=ltpnuma + include $(top_srcdir)/include/mk/testcases.mk CPPFLAGS += -I$(abs_srcdir)/../utils/ -LDLIBS += $(NUMA_LIBS) -lltpnuma -LDFLAGS += -L$(top_builddir)/libs/libltpnuma +LDLIBS += $(NUMA_LIBS) +LTPLDLIBS = -lltpnuma include $(top_srcdir)/testcases/kernel/include/lib.mk include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mremap/Makefile b/testcases/kernel/syscalls/mremap/Makefile index 7bdf425d2..190b7659d 100644 --- a/testcases/kernel/syscalls/mremap/Makefile +++ b/testcases/kernel/syscalls/mremap/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpipc include $(top_srcdir)/include/mk/testcases.mk -mremap04: LDLIBS += -lltpipc +mremap04: LTPLDLIBS = -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rt_sigtimedwait/Makefile b/testcases/kernel/syscalls/rt_sigtimedwait/Makefile index 2055e703b..1ae50b32c 100644 --- a/testcases/kernel/syscalls/rt_sigtimedwait/Makefile +++ b/testcases/kernel/syscalls/rt_sigtimedwait/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpsigwait include $(top_srcdir)/include/mk/testcases.mk -LDLIBS := -lltpsigwait $(LDLIBS) +LTPLDLIBS = -lltpsigwait include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/set_mempolicy/Makefile b/testcases/kernel/syscalls/set_mempolicy/Makefile index a0b79d6e1..55ac0026f 100644 --- a/testcases/kernel/syscalls/set_mempolicy/Makefile +++ b/testcases/kernel/syscalls/set_mempolicy/Makefile @@ -4,6 +4,7 @@ LTPLIBS = ltpnuma include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += $(NUMA_LIBS) -lltpnuma +LDLIBS += $(NUMA_LIBS) +LTPLDLIBS = -lltpnuma include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigtimedwait/Makefile b/testcases/kernel/syscalls/sigtimedwait/Makefile index 2055e703b..1ae50b32c 100644 --- a/testcases/kernel/syscalls/sigtimedwait/Makefile +++ b/testcases/kernel/syscalls/sigtimedwait/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpsigwait include $(top_srcdir)/include/mk/testcases.mk -LDLIBS := -lltpsigwait $(LDLIBS) +LTPLDLIBS = -lltpsigwait include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigwait/Makefile b/testcases/kernel/syscalls/sigwait/Makefile index 2055e703b..1ae50b32c 100644 --- a/testcases/kernel/syscalls/sigwait/Makefile +++ b/testcases/kernel/syscalls/sigwait/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpsigwait include $(top_srcdir)/include/mk/testcases.mk -LDLIBS := -lltpsigwait $(LDLIBS) +LTPLDLIBS = -lltpsigwait include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/sigwaitinfo/Makefile b/testcases/kernel/syscalls/sigwaitinfo/Makefile index 2055e703b..1ae50b32c 100644 --- a/testcases/kernel/syscalls/sigwaitinfo/Makefile +++ b/testcases/kernel/syscalls/sigwaitinfo/Makefile @@ -7,6 +7,6 @@ LTPLIBS = ltpsigwait include $(top_srcdir)/include/mk/testcases.mk -LDLIBS := -lltpsigwait $(LDLIBS) +LTPLDLIBS = -lltpsigwait include $(top_srcdir)/include/mk/generic_leaf_target.mk From patchwork Fri Jul 31 12:15:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1339420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BJ5p21zSqz9s1x for ; Fri, 31 Jul 2020 22:15:22 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8F5A73C4BAC for ; Fri, 31 Jul 2020 14:15:19 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) by picard.linux.it (Postfix) with ESMTP id 56C213C2600 for ; Fri, 31 Jul 2020 14:14:49 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id EE1E620154F for ; Fri, 31 Jul 2020 14:14:48 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A4161AF8E for ; Fri, 31 Jul 2020 12:15:01 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Fri, 31 Jul 2020 14:15:08 +0200 Message-Id: <20200731121508.12805-4-chrubis@suse.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200731121508.12805-1-chrubis@suse.cz> References: <20200731121508.12805-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH 3/3] build system: Silence the output a bit more X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" This hides a few more messages, mostly make entering/leaving directory and the empty library check. Now rebuilding a ltp library and test looks like: $ make BUILD libltpsigwait.a CC sigwait.o ar -rc "libltpsigwait.a" sigwait.o ranlib "libltpsigwait.a" CC sigwait01 While previously (or with a VERBOSE=1) it looks like: $ VERBOSE=1 make make -C "/home/metan/Work/ltp-dev/libs/libltpsigwait/" -f "/home/metan/Work/ltp-dev/libs/libltpsigwait//Makefile" all make[1]: Entering directory '/home/metan/Work/ltp-dev/libs/libltpsigwait' gcc -I../../include -I../../include -I../../include/old/ -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -c -o sigwait.o sigwait.c ar -rc "libltpsigwait.a" sigwait.o ranlib "libltpsigwait.a" make[1]: Leaving directory '/home/metan/Work/ltp-dev/libs/libltpsigwait' gcc -I../../../../include -I../../../../include -I../../../../include/old/ -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -L../../../../libs/libltpsigwait -L../../../../lib sigwait01.c -lltpsigwait -lltp -o sigwait01 Signed-off-by: Cyril Hrubis Reviewed-by: Li Wang --- include/mk/generic_trunk_target.inc | 14 ++++++++++++++ include/mk/lib.mk | 2 +- include/mk/testcases.mk | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/mk/generic_trunk_target.inc b/include/mk/generic_trunk_target.inc index cc255c62a..e89c7f4e0 100644 --- a/include/mk/generic_trunk_target.inc +++ b/include/mk/generic_trunk_target.inc @@ -75,9 +75,16 @@ trunk-install: $(INSTALL_FILES) all: trunk-all clean:: trunk-clean +ifdef VERBOSE @set -e; for dir in $(SUBDIRS); do \ $(MAKE) -C "$$dir" -f "$(abs_srcdir)/$$dir/Makefile" $@; \ done +else + @set -e; for dir in $(SUBDIRS); do \ + echo "DIR $$dir"; \ + $(MAKE) --no-print-directory -C "$$dir" -f "$(abs_srcdir)/$$dir/Makefile" $@; \ + done +endif ifneq ($(abs_builddir),$(abs_srcdir)) $(RM) -Rf $(SUBDIRS) endif @@ -90,9 +97,16 @@ ifeq ($(strip $(SUBDIRS)),) $(error SUBDIRS empty -- did you want generic_leaf_target instead?) else $(RECURSIVE_TARGETS): %: | $(SUBDIRS) +ifdef VERBOSE @set -e; for dir in $(SUBDIRS); do \ $(MAKE) -C $$dir -f "$(abs_srcdir)/$$dir/Makefile" $@; \ done +else + @set -e; for dir in $(SUBDIRS); do \ + echo "DIR $$dir"; \ + $(MAKE) --no-print-directory -C $$dir -f "$(abs_srcdir)/$$dir/Makefile" $@; \ + done +endif endif # vim: syntax=make diff --git a/include/mk/lib.mk b/include/mk/lib.mk index 36e1ba17b..5c310b42a 100644 --- a/include/mk/lib.mk +++ b/include/mk/lib.mk @@ -63,7 +63,7 @@ LIBSRCS := $(filter-out $(FILTER_OUT_LIBSRCS),$(LIBSRCS)) LIBOBJS := $(LIBSRCS:.c=.o) $(LIB): $(notdir $(LIBOBJS)) - if [ -z "$(strip $^)" ] ; then \ + @if [ -z "$(strip $^)" ] ; then \ echo "Cowardly refusing to create empty archive"; \ exit 1; \ fi diff --git a/include/mk/testcases.mk b/include/mk/testcases.mk index bb22be82e..1c81773d0 100644 --- a/include/mk/testcases.mk +++ b/include/mk/testcases.mk @@ -53,7 +53,12 @@ MAKE_DEPS += $(LTPLIBS_FILES) $(LTPLIBS_FILES): $(LTPLIBS_DIRS) $(LTPLIBS_FILES): %: +ifdef VERBOSE $(MAKE) -C "$(dir $@)" -f "$(subst $(abs_top_builddir),$(abs_top_srcdir),$(dir $@))/Makefile" all +else + @echo "BUILD $(notdir $@)" + @$(MAKE) --no-print-directory -C "$(dir $@)" -f "$(subst $(abs_top_builddir),$(abs_top_srcdir),$(dir $@))/Makefile" all +endif LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))