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: 10592237 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 EC12E5A4 for ; Fri, 7 Sep 2018 14:36:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFEA82B5B7 for ; Fri, 7 Sep 2018 14:36:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D414E2B838; Fri, 7 Sep 2018 14:36:04 +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 C06B32B5B7 for ; Fri, 7 Sep 2018 14:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728564AbeIGTRO (ORCPT ); Fri, 7 Sep 2018 15:17:14 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:42454 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728576AbeIGTRN (ORCPT ); Fri, 7 Sep 2018 15:17:13 -0400 Received: by mail-oi0-f65.google.com with SMTP id v198-v6so9927782oif.9 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=CEww8kyYQs0/PhGTlRDch6tW03LlOa8nxPT+kA1gqARk6Idu8iDyxJM64E6kBAqxLZ ODxS/htFumifappYp2lxXMS0k5JqhgO/z59dUp9KhdE6Qrh40TrcFpzONCOPSsRmJOk2 3RBSr/rG9uUa6+X0ypTnMJ8XnT0yj6pE33P/BHKIoSiv19uMNxNDmN88PE9EaHSgj7QR m4+Q73w3uoPFlof3FC4U/jHLpozat7CQ50x093AWW2ADeTLuuG7OAVXt+VZfRn2gF50E 4vpfLDWzwP4ODlouppTS1c62WNV9K1jGWZ8Ym9XPPYNs0ZIhCWtKL/WK8Ub+97xiNbDB xhlw== X-Gm-Message-State: APzg51CmAyeFYYJNzOUIzXQvBeQeYRAGB7YDYO7jp7HH/ACOK8zOTwSp /O9/bYZuFffZG6+f1qoHy/UJlQ== X-Google-Smtp-Source: ANB0VdY4Sj/e/UqGIW8DgBOHr8CgUcozfSZU/AGlcKdOYIMMmUSI/6Pd5Q7hqR0yg07fNIGo6zBpJw== 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-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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: 10592239 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 E8A3C112B for ; Fri, 7 Sep 2018 14:36:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCB832B5B7 for ; Fri, 7 Sep 2018 14:36:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D059B2B838; Fri, 7 Sep 2018 14:36:10 +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 78C792B5B7 for ; Fri, 7 Sep 2018 14:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729903AbeIGTRW (ORCPT ); Fri, 7 Sep 2018 15:17:22 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:34771 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729902AbeIGTRW (ORCPT ); Fri, 7 Sep 2018 15:17:22 -0400 Received: by mail-oi0-f66.google.com with SMTP id 13-v6so27711829ois.1 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=DHojfV/1G3Obw1En1Fcbq3MkGoq5U8Fpax4v1KcVcqDzizf2ABPEwaO7GD/wGTHB+d QI83GeodqFQDw++yZ7gSkbhJmRXihSJAoJVKa58XO+qO5qFvPXYRrtlHKp3Qd3pGWUA2 Tp9TZGPzIpoZuMiR4lU5DKyX9Xuyedfpq2cs1viduh9ZYYLZIqIWf7BtreG3Ci+3cpDY SWqHSzeH+qT2HqnwCrOnCRWyagmbEi5Z/brscm+Kz0b2YFrB8AUBO/5clz3mjME1LMo1 +MdSoNdclCyMIfI5u4/AlgcA7cfYu1tRX0O2Quds3F1dFexp4rr8E2odyfRcyoS+IGWd ejag== X-Gm-Message-State: APzg51CthYHpqUP8vY7ogqa3r47PjjHm7C24LBoM4IQJ0Mt4Wtwr0w3H z6A1IOrnBeKHHUdsgWLj0+7i/A== X-Google-Smtp-Source: ANB0Vdba0NX3ECkpFQ5JgG3UATvzWExoPcsbOmotDbNGveVHzK05HpwbTrxmpbLj4lovD1u3GlmIAw== 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-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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)