Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2807765ybn; Thu, 26 Sep 2019 18:19:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqydmOAOVHfJlJaYyXuR8kzMTLZgtLmgGm8to7oiipQgnNj/m9C7JQse1pBU+3AMnABfk/VZ X-Received: by 2002:a50:c052:: with SMTP id u18mr1948665edd.88.1569547145441; Thu, 26 Sep 2019 18:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569547145; cv=none; d=google.com; s=arc-20160816; b=YcQa+wdenAItlesbtBFJGRXsjCmZH67pOy/JKPTovoe5UfkV5xWXnY+uOHXevetWaS gFaKWnkV4xhF3xoOLfluQgotTz23iNU1bghcgY9sZkH8PioKum51xrMi01eg75EWzmzt jNlDB2YjBvzRh4P3LQ/nZQWc1egXbBYwMGEKGoxH/tMN9A57tfKt9GSOzEu4iE+0n+xN gaDYv5IpnqB3An6M++ZYwyjKNJHE9Gm6nT9V2SvI70jLeTxlGXEevInFVE+Xc6AIKJsE IXFvHiGoe3wOcoNF+1+pEgqA/Myb6jjdCBarPizIMDBo1aRbjNojWdSsDlqr5JUgfh5o znfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=H2GyEMBjk27THtCkzskXmMVgGtiHssCWYkVZJhAzOdg=; b=HpjuEwmHe8OMVoWoCZ6E/aalrJVUtcaRsCH+Ch4lVTBFjPLO+VrErycag1EqI6+U25 SpcTikIRILUKHUgCELJwgQV1REuDaNYEw4221jO9rLfC41d4HRUAC8jgyOZlAYD5OKn6 sM7a6PgDttowgUUhZGCKz47S0jktiHuCnYDjvty8s4Wnha47h5dTo1OkqqH2idaPXLA0 LtMnr5vsJ2TJnlMfzLevvcpbEEeYoWv4qGkbrlUdAWc2ekpwZW8UHfxF1kPf4n7jauI5 rm0mA8CTaNBjxyp+AOMriMGKWcQdPkxuwGqhiYPpCGqzKxYKPowm/m7UE679+C9rCDJz ueeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=BY3eP8mG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b20si602775edc.359.2019.09.26.18.18.41; Thu, 26 Sep 2019 18:19:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=BY3eP8mG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbfI0BQp (ORCPT + 99 others); Thu, 26 Sep 2019 21:16:45 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45400 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfI0BQo (ORCPT ); Thu, 26 Sep 2019 21:16:44 -0400 Received: by mail-io1-f68.google.com with SMTP id c25so11745092iot.12 for ; Thu, 26 Sep 2019 18:16:44 -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=H2GyEMBjk27THtCkzskXmMVgGtiHssCWYkVZJhAzOdg=; b=BY3eP8mGIkLH/kjnNmwFxxobZiK8CoYQi9lyd2yXukK5S/NAvSa5KF4f8hpeLfkQuM hHoxaOV2Pa6GF2CZECb3AqZAjQ8p/pS1vAuURM2Totchz2gfdi/b/I0AjYAv0jGL0aKX 552gq4qW4lMnHWn2Ek2jKIBttdf8IHEWRQcnU= 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=H2GyEMBjk27THtCkzskXmMVgGtiHssCWYkVZJhAzOdg=; b=BIRvQFS15crB9uJh4tyjJ3NmRZcf1uG/5ZnKbkAac03ceC++VeN6YcH2QpqDSyTmwl 7lW9nDbRpkI1TjTncWFv5tvWK5sMZjKjX+TBshEDiSNVvHZwHgQzN2mXQJCysM+wjDTY sz4HWqKd2fLYNYxmDnLyftEwFsL/vfb+Jbyz1I8dOLJEeaDS+hNoG/tMqeeqaQ7MdXlL NTIruYjnOoj05C7ptTzgYwY3r7gCZagMDsKlbkPX6t41dL5zBJQexBvOYZNZbYI/k6a0 +6fKZ/OU978Mnd39mTNGBjWt4pBVTvHsbvBtssTvscvxHIFxaUiYJNMMyrR6k8+GOO/A tl+A== X-Gm-Message-State: APjAAAWKGUhWvvJ+O4iPzNxz/gomFsNKLMQ8/1n7ADheucgx5kD+KI5H czt3SvilHBrfnK+9L7QLP0GMtPqv908= X-Received: by 2002:a6b:fa07:: with SMTP id p7mr6298691ioh.164.1569547003964; Thu, 26 Sep 2019 18:16:43 -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 x2sm1652121iob.74.2019.09.26.18.16.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 18:16:43 -0700 (PDT) From: Shuah Khan To: linus.walleij@linaro.org, bgolaszewski@baylibre.com Cc: Shuah Khan , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH RESEND] tools: gpio: Use !building_out_of_srctree to determine srctree Date: Thu, 26 Sep 2019 19:16:41 -0600 Message-Id: <20190927011641.4858-1-skhan@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org make TARGETS=gpio kselftest fails with: Makefile:23: tools/build/Makefile.include: No such file or directory When the gpio tool make is invoked from tools Makefile, srctree is cleared and the current logic check for srctree equals to empty string to determine srctree location from CURDIR. When the build in invoked from selftests/gpio Makefile, the srctree is set to "." and the same logic used for srctree equals to empty is needed to determine srctree. Check building_out_of_srctree undefined as the condition for both cases to fix "make TARGETS=gpio kselftest" build failure. Signed-off-by: Shuah Khan --- Rsending with corrected address for linux-kselftest@vger.kernel.org tools/gpio/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile index 6ecdd1067826..1178d302757e 100644 --- a/tools/gpio/Makefile +++ b/tools/gpio/Makefile @@ -3,7 +3,11 @@ include ../scripts/Makefile.include bindir ?= /usr/bin -ifeq ($(srctree),) +# This will work when gpio is built in tools env. where srctree +# isn't set and when invoked from selftests build, where srctree +# is set to ".". building_out_of_srctree is undefined for in srctree +# builds +ifndef building_out_of_srctree srctree := $(patsubst %/,%,$(dir $(CURDIR))) srctree := $(patsubst %/,%,$(dir $(srctree))) endif -- 2.20.1