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)