From patchwork Mon Jan 14 13:51:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762607 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F270A13B4 for ; Mon, 14 Jan 2019 13:52:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDE98289DA for ; Mon, 14 Jan 2019 13:52:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0C9428C03; Mon, 14 Jan 2019 13:52:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7235F28BD9 for ; Mon, 14 Jan 2019 13:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbfANNwE (ORCPT ); Mon, 14 Jan 2019 08:52:04 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:51456 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726690AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id QDrm1z00C3XaVaC01DrmK8; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000F2-7x; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006oQ-66; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 11/12] selftests: Add kselftest-build target Date: Mon, 14 Jan 2019 14:51:43 +0100 Message-Id: <20190114135144.26096-12-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The documented way to build kselftest is to run make -C tools/testing/selftests with an optional "O=..." parameter to specify the output directory. However, all of the above assume you run make from the source directory. while other make commands can simply be run from the output directory, too (the autogenerated Makefile in the output directory takes care of this). Add a "kselftest-build" target, so "make kselftest-build" can be used from either the source or output directory. Signed-off-by: Geert Uytterhoeven --- Perhaps this make target should just be called "kselftest", and the existing "kselftest" target be renamed to "kselftest-run"? --- Documentation/dev-tools/kselftest.rst | 4 ++++ Makefile | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst index 7756f7a7c23b9408..b90b4ee6334a0941 100644 --- a/Documentation/dev-tools/kselftest.rst +++ b/Documentation/dev-tools/kselftest.rst @@ -21,6 +21,10 @@ To build the tests:: $ make -C tools/testing/selftests +Or: + + $ make kselftest-build + To run the tests:: $ make -C tools/testing/selftests run_tests diff --git a/Makefile b/Makefile index 5355033dda6ed1ea..27a56de7ed45091e 100644 --- a/Makefile +++ b/Makefile @@ -1193,6 +1193,10 @@ PHONY += kselftest kselftest: $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests O=$(abspath $(objtree)/tools/testing/selftests) INSTALL_HDR_PATH=$(abspath $(INSTALL_HDR_PATH)) +PHONY += kselftest-build +kselftest-build: + $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests O=$(abspath $(objtree)/tools/testing/selftests) INSTALL_HDR_PATH=$(abspath $(INSTALL_HDR_PATH)) + PHONY += kselftest-clean kselftest-clean: $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests clean O=$(abspath $(objtree)/tools/testing/selftests) @@ -1445,6 +1449,7 @@ help: @echo ' kselftest - Build and run kernel selftest (run as root)' @echo ' Build, install, and boot kernel before' @echo ' running kselftest on it' + @echo ' kselftest-build - Build kselftest files' @echo ' kselftest-clean - Remove all generated kselftest files' @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing' @echo ' .config.'