From patchwork Fri Mar 8 12:42:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1053470 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44G6cX4sNgz9s70 for ; Fri, 8 Mar 2019 23:43:39 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8ACC13EA7AB for ; Fri, 8 Mar 2019 13:43:35 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 8DCEA3EA771 for ; Fri, 8 Mar 2019 13:43:34 +0100 (CET) Received: from mx1.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-3.smtp.seeweb.it (Postfix) with ESMTPS id 6ED791A01A78 for ; Fri, 8 Mar 2019 13:43:33 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 115ACB018; Fri, 8 Mar 2019 12:43:33 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Fri, 8 Mar 2019 13:42:57 +0100 Message-Id: <20190308124257.25282-2-chrubis@suse.cz> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190308124257.25282-1-chrubis@suse.cz> References: <20190308124257.25282-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 2/2 v2] libs: Hook up libs into the build system X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 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 hooks up libs/ subdirectories into the build system so that tests needs only specify which library from libs/ directory we should link againts. Which sets up the path to the library in LDFLAGS and also causes the library to be rebuild even when make is executed from the directory with testcases. Now the test only needs to set up LTPLIBS variable with a list of optional libraries to link against and LDLIBS, since as far as I know we have to maintain the order of the libraries manually. Signed-off-by: Cyril Hrubis CC: Jan Stancek CC: Petr Vorel --- include/mk/testcases.mk | 16 +++++++++++++++- testcases/kernel/syscalls/set_mempolicy/Makefile | 3 ++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/mk/testcases.mk b/include/mk/testcases.mk index bf97384a7..131854ec7 100644 --- a/include/mk/testcases.mk +++ b/include/mk/testcases.mk @@ -41,5 +41,19 @@ INSTALL_DIR := testcases/bin LDLIBS += -lltp -$(APICMDS_DIR) $(LIBLTP_DIR): %: +ifdef LTPLIBS + +LTPLIBS_DIRS = $(addprefix $(abs_top_builddir)/libs/lib, $(LTPLIBS)) +LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach LIB,$(LTPLIBS),lib$(LIB)/lib$(LIB)))) + +MAKE_DEPS += $(LTPLIBS_FILES) + +$(LTPLIBS_FILES): $(LTPLIBS_DIRS) + $(MAKE) -C "$^" -f "$^/Makefile" all + +LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS)) + +endif + +$(LTPLIBS_DIRS) $(APICMDS_DIR) $(LIBLTP_DIR): %: mkdir -p "$@" diff --git a/testcases/kernel/syscalls/set_mempolicy/Makefile b/testcases/kernel/syscalls/set_mempolicy/Makefile index b79a53faf..a0b79d6e1 100644 --- a/testcases/kernel/syscalls/set_mempolicy/Makefile +++ b/testcases/kernel/syscalls/set_mempolicy/Makefile @@ -1,8 +1,9 @@ top_srcdir ?= ../../../.. +LTPLIBS = ltpnuma + include $(top_srcdir)/include/mk/testcases.mk -LDFLAGS += -L$(top_builddir)/libs/libltpnuma LDLIBS += $(NUMA_LIBS) -lltpnuma include $(top_srcdir)/include/mk/generic_leaf_target.mk