From patchwork Fri Sep 7 14:34:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_D=C3=ADaz?= X-Patchwork-Id: 146210 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1257675ljw; Fri, 7 Sep 2018 07:36:03 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb1FidShXAMZ6BVae6MZKn41ZXoFtSNaPsUlFX9zGc/qmQgQbEmWxR6+wFkGBszTi0lWmRz X-Received: by 2002:a62:9645:: with SMTP id c66-v6mr8934033pfe.56.1536330963001; Fri, 07 Sep 2018 07:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536330962; cv=none; d=google.com; s=arc-20160816; b=j6lFfJ7Z1+En0122bcuyxxHMvs/KEw43UUUIz+XbtNaYfp6ufJc3pCa8VNGHOsgHqU tIVU3d3BJ/wpTKxkv4Ozjhcsw6ERUq30h7jkjc4upgfT1R/E82aPwrI3iBDicGd2ouoI mtdX0oFZ97NErjsUEzk6FxFx68h/peHK7tgpF2gOI/iMZBhyj/13DCUql73McUkZiz7k sSSScakHPCiIX/LKFsq6A3pHwMPAqltQFirWPjTNFmAv+MolV7b8MhvM0WTtOA2jSXzf n2It3OwUtPLvOioD2Oxi3iSikRap1XiYXzCXdouAylbhx7SJnDFcyMwPPel1Xq3T7uCd 9nbw== 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=MTJMlsL/qn3+Dab4i8dJ2bnn9KxJOVfBWvsWQ3iChLM=; b=cRkqKILR/yoNhJr6Job6j75ugXDVxILJeaMAs4N0vVq85rqEtvfDUiP/PMNvzguzK1 emm7sYGrMCttEpwdGhdhxiOpfl1Yvh1JnTvLnT624/1mKyTQigFbNhkaIAUcsDniRluh p3pKfSMpZZW0U6/xHuq4iDJ4L8xmveDnFpmStQlCQGUX8Qxx5mZGfddhQBhNwwWgNyX+ //HEfYhw97tTuXxR03JIkuHYJj6f2m1iX7SelLSF8DeUNvDgIOn6rTnBybpwqID10+sa k/wdgiA0ln9fuZhVf2NzqC/TsLn9gO2snYnv33WO1ABh7weg0F9hriiz+oQ4kl44v6LQ lPKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LwGDDimF; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn19si8173277plb.360.2018.09.07.07.36.02; Fri, 07 Sep 2018 07:36:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=@linaro.org header.s=google header.b=LwGDDimF; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728576AbeIGTRO (ORCPT + 5 others); Fri, 7 Sep 2018 15:17:14 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:34738 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727659AbeIGTRN (ORCPT ); Fri, 7 Sep 2018 15:17:13 -0400 Received: by mail-oi0-f68.google.com with SMTP id 13-v6so27710955ois.1 for ; Fri, 07 Sep 2018 07:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MTJMlsL/qn3+Dab4i8dJ2bnn9KxJOVfBWvsWQ3iChLM=; b=LwGDDimF6XRqHckkC2nHruCIBfW8R0074mLtWo+j4z7KEJV/Yi/JzZ/IkjNg+aQMzs Wrr8mfpu6mT4oyNNOsPwvr/tboAI0SnNdzPNldoF1zg0Gqkg271N4HGcmUozFFjtVA/O KIbeGEyTdxATnhHNaufH/r0KoQoQ4V10IeAlI= 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=MTJMlsL/qn3+Dab4i8dJ2bnn9KxJOVfBWvsWQ3iChLM=; b=XlGnZm/TRUTtMkodCA4cr7MAN/rFyQmYMMl18jg9Xxg/Jwy+0cYbDCYY/x8uUx3h4Y 9A+E5wZhdcE6UzV1RZFFRuexNHf/VJenCXPn9Va/lQXBkeffoxCRGKuwQRqjvwLz6mdH tMLveB+CpoK4iB5Yr2Nr4m6xliBqSNO9ELgEfPXwRaOSOVzP/BNZ0QaUsXzkVLfIlzSq 1BHsVkKurcmjtU0LIKvr7UiWNT1VYllWUEoz0UWtnemswkYW+265QlwaSquwOc6CuhHk SKvtMYLeWT1+x/Mkl6jqJuGPk6augI7goC3BszM05OL0g4iGk3F9QMBt6sjh/jGR6Ucb tY3w== X-Gm-Message-State: APzg51AjtkNKBlJad2slnxXb7M2dlrF+yuNRxZAopncDyqHOtCOYQLFB LxVHcy6ll4FdFszCZgMdDK5oVg== X-Received: by 2002:aca:ac54:: with SMTP id v81-v6mr8010762oie.1.1536330960021; Fri, 07 Sep 2018 07:36:00 -0700 (PDT) Received: from aura.cortijodelrio.net ([187.161.144.121]) by smtp.googlemail.com with ESMTPSA id i132-v6sm10306360oif.20.2018.09.07.07.35.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Sep 2018 07:35:58 -0700 (PDT) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: linus.walleij@linaro.org, Fathi Boudra , =?utf-8?q?Daniel_D=C3=ADaz?= , Bamvor Jian Zhang , Bartosz Golaszewski , Shuah Khan , linux-gpio@vger.kernel.org (open list:GPIO MOCKUP DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 1/2] selftests: gpio: restructure Makefile Date: Fri, 7 Sep 2018 09:34:54 -0500 Message-Id: <1536330895-8391-1-git-send-email-daniel.diaz@linaro.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Fathi Boudra This patch cleans up the Makefile by restructuring a couple of things, namely: 1) change explicit paths in targets for variables 2) substitute a variable (BINARIES) for another, part of the selftests build system (TEST_PROGS_EXTENDED) 3) proper cleaning up of the EXTRA objects The resulting Makefile is much more readable and manageable. Signed-off-by: Fathi Boudra Signed-off-by: Daniel Díaz --- tools/testing/selftests/gpio/Makefile | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index 4665cdb..a4a01ec8 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -1,28 +1,26 @@ # SPDX-License-Identifier: GPL-2.0 +CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ +LDLIBS += -lmount -I/usr/include/libmount + TEST_PROGS := gpio-mockup.sh -TEST_FILES := gpio-mockup-sysfs.sh $(BINARIES) -BINARIES := gpio-mockup-chardev -EXTRA_PROGS := ../gpiogpio-event-mon ../gpiogpio-hammer ../gpiolsgpio -EXTRA_DIRS := ../gpioinclude/ -EXTRA_OBJS := ../gpiogpio-event-mon-in.o ../gpiogpio-event-mon.o -EXTRA_OBJS += ../gpiogpio-hammer-in.o ../gpiogpio-utils.o ../gpiolsgpio-in.o -EXTRA_OBJS += ../gpiolsgpio.o +TEST_FILES := gpio-mockup-sysfs.sh +TEST_PROGS_EXTENDED := gpio-mockup-chardev + +GPIODIR := ../../../gpio +GPIOOBJ := gpio-utils.o include ../lib.mk -all: $(BINARIES) +all: $(TEST_PROGS_EXTENDED) override define CLEAN - $(RM) $(BINARIES) $(EXTRA_PROGS) $(EXTRA_OBJS) - $(RM) -r $(EXTRA_DIRS) + $(RM) $(TEST_PROGS_EXTENDED) + $(MAKE) -C $(GPIODIR) clean endef -CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ -LDLIBS += -lmount -I/usr/include/libmount - -$(BINARIES):| khdr -$(BINARIES): ../../../gpio/gpio-utils.o +$(TEST_PROGS_EXTENDED):| khdr +$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) -../../../gpio/gpio-utils.o: - make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio +$(GPIODIR)/$(GPIOOBJ): + $(MAKE) -C $(GPIODIR) From patchwork Fri Sep 7 14:34:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_D=C3=ADaz?= X-Patchwork-Id: 146211 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1257820ljw; Fri, 7 Sep 2018 07:36:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbUPDeUVQSHqNddLQGJMC5UF/KSfUzngdDJZNx3nBPibz+grd3jh9bG5WLfY2ZylBeOznGQ X-Received: by 2002:a63:1e0b:: with SMTP id e11-v6mr8556065pge.44.1536330971158; Fri, 07 Sep 2018 07:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536330971; cv=none; d=google.com; s=arc-20160816; b=fXRqxdnKcpEVQZQLLGRQobevx6hIK4SYDT04pgPxKn6L7tRztq2X+3o5FG273ZNZUr +i5fxaEfLw5wF84/Gw9EZT/CTeL9M9yTOsZgAOlWmlJO54r6B5MLTaaqkQnvELjAHwfH 6c50ReAnJ3EiQrsZRhc8D9JQZajdFFnMcIcnW7WOxGGt0x49GeW1bIqFsS8dhtPS4Pgy ZC8JyeRLX3z1KgfjevlQFRW0ta3agUr07Mf8/+3dRiH2Z1v1tTdTicwu3Jp3nCLnHhBD ZxExMukl4rvLhvbp/y81L9BDyYwFsZar59h9TL58+gmjd6j1/tcvMx7SGMSgI0yYdFir iO8A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7uICIwEpFod9siHFcDEy/0W3rcrfNV0csFkXyZ5W1rc=; b=S0bOuyXpOevV291nrHQxMAWkrpogZTJrC9U123Vl8C2junP9X1wnojFk7oEqrz9qU3 aP50dZYDN+Pwg6Xw/gIjv6Z9cOzKBMRqCC6qj6hFLKR2rjbLlZ3QSMgw/P9E4YIRWgD6 m6CjwNAiAvDGNnDaXfO2efDDmkPPKI7zqRgkF+a2kLmBzSC18iT495XhKwMYXscZ1ZDf NQu2oLvPKnYp3E+Smcjwz3sW7aV+3D01devgruclfCQEIE5KD1SaIaxonGf7TK0MWfKZ GsIFJbp6f0JFnJLqx6w7crmKGdl0MuaIC7qluQb00Mqj22K7GSdjwnGbtDeytRwusHP6 Gk2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E0r+rPU7; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn19si8173277plb.360.2018.09.07.07.36.10; Fri, 07 Sep 2018 07:36:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=@linaro.org header.s=google header.b=E0r+rPU7; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729902AbeIGTRW (ORCPT + 5 others); Fri, 7 Sep 2018 15:17:22 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:33349 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729899AbeIGTRW (ORCPT ); Fri, 7 Sep 2018 15:17:22 -0400 Received: by mail-oi0-f66.google.com with SMTP id 8-v6so27674470oip.0 for ; Fri, 07 Sep 2018 07:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7uICIwEpFod9siHFcDEy/0W3rcrfNV0csFkXyZ5W1rc=; b=E0r+rPU7V1yvYTI8gTotBRFPF4fJWfx8u0WddAnkyHPoSnSACpuh6v9Lv4luAk9nqx 6oEjopJxRrZw/z9kbtMKp7iUh7xUXi9OkelX6e+geZeNBWjKm03JwuAWKxcstZrYO9LU DaZTHigog3vXdUxlmJwZRrSb5rsbS61HQX03c= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=7uICIwEpFod9siHFcDEy/0W3rcrfNV0csFkXyZ5W1rc=; b=nViX0wmjKRCWzh03S211CvMaR/U42oExzF5vyG6hDFOgGKm5gAHlrG2H2L2brSASd6 /T5uOsvnughu7KdYlBjBzmQTNBetEPl3jXg/sG6KCTqn8u83IRUF0Nt+ph5qGrI0tvyy 1Er9D1pIFbrduhBS1vfhmhjwtngCUN8dQYwwr38f6vX+aOhF/oQlYwhP6sPDnNCb5C1X NInuIXpbGsR9KzI3xIMKvQWla5k2opuZWA8o0ohSwytyhSoxKmih23iIlsJuR7mNyHlp 8jcbnSP8xc91/u+2oHkLopd+5HCu6J8G/r8exjwPVBUQu/urRQtcm33ACPdgK/GKJ9AS GdKw== X-Gm-Message-State: APzg51C3bkyF1JMYjoffCrEPjt30bVy1jJM7wcyliKsHyWnu4FeZDHSN s9izoecF/To8D18Md3EexK94Dw== X-Received: by 2002:aca:4186:: with SMTP id o128-v6mr7794664oia.286.1536330969197; Fri, 07 Sep 2018 07:36:09 -0700 (PDT) Received: from aura.cortijodelrio.net ([187.161.144.121]) by smtp.googlemail.com with ESMTPSA id i132-v6sm10306360oif.20.2018.09.07.07.36.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Sep 2018 07:36:08 -0700 (PDT) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: linus.walleij@linaro.org, =?utf-8?q?Daniel_D=C3=ADaz?= , Bamvor Jian Zhang , Bartosz Golaszewski , Shuah Khan , linux-gpio@vger.kernel.org (open list:GPIO MOCKUP DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 2/2] selftests: gpio: Fix OUTPUT directory in Makefile Date: Fri, 7 Sep 2018 09:34:55 -0500 Message-Id: <1536330895-8391-2-git-send-email-daniel.diaz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536330895-8391-1-git-send-email-daniel.diaz@linaro.org> References: <1536330895-8391-1-git-send-email-daniel.diaz@linaro.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When simply running `make' from the selftests top dir, this error shows up: cc -O2 -g -std=gnu99 -Wall -I../../../../usr/include/ -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid gpio-mockup-chardev.c ../../../gpio/gpio-utils.o -lmount -o gpio-mockup-chardev cc: error: ../../../gpio/gpio-utils.o: No such file or directory : recipe for target 'gpio-mockup-chardev' failed make[1]: *** [gpio-mockup-chardev] Error 1 because the output directory is set to "selftests/gpio" and all binaries built from ../../../gpio/ end up there. In fact, they appear as, exempli gratia: * gpiogpio-event-mon * gpiogpio-hammer * gpioinclude/ * gpiolsgpio which is wrong, as it's missing a directory separator somewhere. This patch sets straight the output directory when building ../../../gpio/ so that binaries don't cross paths. Signed-off-by: Daniel Díaz --- tools/testing/selftests/gpio/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index a4a01ec8..4664842 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -7,7 +7,7 @@ TEST_PROGS := gpio-mockup.sh TEST_FILES := gpio-mockup-sysfs.sh TEST_PROGS_EXTENDED := gpio-mockup-chardev -GPIODIR := ../../../gpio +GPIODIR := $(realpath ../../../gpio) GPIOOBJ := gpio-utils.o include ../lib.mk @@ -16,11 +16,11 @@ all: $(TEST_PROGS_EXTENDED) override define CLEAN $(RM) $(TEST_PROGS_EXTENDED) - $(MAKE) -C $(GPIODIR) clean + $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean endef $(TEST_PROGS_EXTENDED):| khdr $(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) $(GPIODIR)/$(GPIOOBJ): - $(MAKE) -C $(GPIODIR) + $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR)