From patchwork Fri Apr 19 23:23:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 10909859 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 ADC6317E0 for ; Fri, 19 Apr 2019 23:23:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F6FF28901 for ; Fri, 19 Apr 2019 23:23:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93F7228E16; Fri, 19 Apr 2019 23:23:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 4001328901 for ; Fri, 19 Apr 2019 23:23:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726072AbfDSXXN (ORCPT ); Fri, 19 Apr 2019 19:23:13 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:51123 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfDSXXN (ORCPT ); Fri, 19 Apr 2019 19:23:13 -0400 Received: by mail-it1-f193.google.com with SMTP id q14so2901184itk.0 for ; Fri, 19 Apr 2019 16:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=atDLwfDA7rORBqIZfz3seZ7IuymQDCP5i79eWQ4zDT4=; b=Ighg3CZPP+6vgzIT3bMIXesO9zQBozDpimUhknWGsi0JEbwpnx2IaiyCI2K74j6qUz xZvSiF52VBmhcPFZX8a9O12h2XyDDOPJ4zV3Oorf7eetH+3Kk1I3CrGlnpw9ILNDJiSJ 6CGwzDS59y/f0kOIPXDvGzMT4YM2rMpsD7k3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=atDLwfDA7rORBqIZfz3seZ7IuymQDCP5i79eWQ4zDT4=; b=Nsx8N7We4DTTvazotr7b/wtcjBRlysjpRCCmb3pP6g8OLjrAwBiz7x0sQkum2LWHSj idOc8KPt9ynNCchmWV/T/2Ms3Z4EMO1mQEali35xAjy7MtTM986kVJJ50OTX48BZ7ipe NuGW38MwdT3uzP+CogryKw140Z4kQOQ/XK55rmQVvv8DqATjokk8iBjxqGcHkTYj0fjg i1lfp/MsCcuNJr02CQh2OJYIRPpvSNPnEZMVKaS1Vj/d/VuWmeViOqu+3koenuMkGs21 57jjgafAd1I1AyC0x2edMQDwUIJ35Btkz+zWcNBAyGLYkTzSZMX5EWqvCtmWykS9ZQ/m KI9g== X-Gm-Message-State: APjAAAW2JO5SAtOgBvYEnc56nIqq6IWI7wyIqwBQXwPJWffeGK0PRBVH l8fMgbkWcROF6XIk2uUlpKn0TQ== X-Google-Smtp-Source: APXvYqwni5eAyDRmxZmesoEfO555+37agRpyLsf83X/89yW+65bYnGITpCpbJAlxikHedtZnFogshw== X-Received: by 2002:a24:454e:: with SMTP id y75mr5358364ita.5.1555716192955; Fri, 19 Apr 2019 16:23:12 -0700 (PDT) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id y17sm4672375ita.2.2019.04.19.16.23.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2019 16:23:11 -0700 (PDT) From: Shuah Khan To: shuah@kernel.org Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: build and run gpio when output directory is the src dir Date: Fri, 19 Apr 2019 17:23:09 -0600 Message-Id: <20190419232309.9664-1-skhan@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Build and run gpio when output directory is the src dir. gpio has dependency on tools/gpio and builds tools/gpio objects in the src directory in all cases making the src repo dirty even when object relocation is specified. This fixes the following commands from generating gpio objects in the source repository: make O=dir kselftest export KBUILD_OUTPUT=dir; make kselftest make O=dir -C tools/testing/selftests expoert KBUILD_OUTPUT=dir; make -C tools/testing/selftests The following still don't work (need fixing in gpio Makefile): make O=dir kselftest TARGETS="gpio" export KBUILD_OUTPUT=dir; make kselftest TARGETS="gpio" make O=dir -C tools/testing/selftests TARGETS="gpio" expoert KBUILD_OUTPUT=dir; make -C tools/testing/selftests TARGETS="gpio" Signed-off-by: Shuah Khan --- tools/testing/selftests/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index b43c5f41fb3e..f2ebf8cf4686 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -99,6 +99,15 @@ ARCH ?= $(SUBARCH) export KSFT_KHDR_INSTALL_DONE := 1 export BUILD +# build and run gpio when output directory is the src dir. +# gpio has dependency on tools/gpio and builds tools/gpio +# objects in the src directory in all cases making the src +# repo dirty even when objects are relocated. +ifneq (1,$(DEFAULT_INSTALL_HDR_PATH)) + TMP := $(filter-out gpio, $(TARGETS)) + TARGETS := $(TMP) +endif + # set default goal to all, so make without a target runs all, even when # all isn't the first target in the file. .DEFAULT_GOAL := all