From patchwork Wed Feb 21 23:22:52 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: 129140 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1154553ljc; Wed, 21 Feb 2018 15:23:26 -0800 (PST) X-Google-Smtp-Source: AH8x224WzlUujV4izkG7qHUGE0J+bXZxQzxQw8A0PcXPOuHwfUp7bdzVmv0P3JyD/j7rhjz7T24H X-Received: by 2002:a17:902:7b92:: with SMTP id w18-v6mr4482075pll.159.1519255406318; Wed, 21 Feb 2018 15:23:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519255406; cv=none; d=google.com; s=arc-20160816; b=b1TvfJ6O1vGaPQWfMwgHz4ouuWCrnd6rCT8t5ojXW1g0tJ5xj7eggPvsD2NZN4vRNd cfX+sdBhRF5KADeae4bi5NFIh+39tBnc7EuZJ1D+NICrs1Ev1buZEW3HJAnahalvXlEV loOqYzajt+NN/lNQMLQthrb94lM1SgXSUlvKk5QRqLm5FffAOcplLXZoFpzkdG6RW/T1 q1riTtoabrKhr7A1DHuxSc/0NOiXkRoM4ItR8Oa/v4ODMM3QqkfC86mWRrBInWQ4nl2O +G/h3VISF/42ESQvhf5XBFgIOb94A/YJSvoVhaK82IS/13fKtKafwKxrNnw0FyZEUnkh /EyQ== 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:arc-authentication-results; bh=E9QcLMnFZS5KsVsjcuUdCORhjEli4RFxS8mZnRqy+CY=; b=cG4lG2F4zJ6aQHksr0tn9yxB4CGDc+g4lTIh3oJF+4OyLqWK64CFyfeuhPC9vPumOD nCBj2a27pm9TgIcV5bB6WWIaFfTh1mk7aAip0QDtu1yJ1pSEKv4c6HVzK0D+3FLER+vk Gb+k1rddTtcKmKfevWuw9DVhz+fcxpqNvwbFQJXq+Wu4wNhM+HlRd56CG648wsVDHiCb 4SfRXtRWF4+JgX4JuHBXYNvuV2J2CUUbAOczXXYad0d2nbBQlFWTiBW4OsM+0Q2tPcuO azjWGBJU9u2ve9f8s3c6U5OpSn5tvHNB9oygYRSGznReurvEFEt6Dfj2UoXkr6A1DrSA aDQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kqL4orWw; 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=fail (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 i10-v6si2204957plr.670.2018.02.21.15.23.26; Wed, 21 Feb 2018 15:23:26 -0800 (PST) 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=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kqL4orWw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751274AbeBUXXZ (ORCPT + 5 others); Wed, 21 Feb 2018 18:23:25 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:33847 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbeBUXXX (ORCPT ); Wed, 21 Feb 2018 18:23:23 -0500 Received: by mail-ot0-f193.google.com with SMTP id n74so2819762ota.1 for ; Wed, 21 Feb 2018 15:23:23 -0800 (PST) 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=ffCB61WyqFNki+CLyEvRnENXUfxYejTOg46O6k1+LFc=; b=kqL4orWwm/lS003F1w4p5TKQRBbOKwJfp+KrOUKqT817xWQ46qyYysEe/K/dBwu8Tz QHjAVvTW8BvmAq5p9lML7V1VDQ3qs6ruRURCIS4absFEtAlzYGN1sWCCb7+D8liKzVeP 2OeWXYQMndIXaEA3wjojFJZOLFtvkamp8xDq8= 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=ffCB61WyqFNki+CLyEvRnENXUfxYejTOg46O6k1+LFc=; b=gXgXMgZWXCrNpwDVSbm0Alr82IqfhmyC5jNzVTa9pTRlTV1QYLRGDB94PIa7Df3RwD fCTDQQ09rx6jF3kpz2dtWlNQEOUrNMmbO6dR0qN4KcYRKVfe/XBSwLGe0F1WXjEURWWV 5wq5s7gYwBlbH1xdnz/EYOc7diLLe1GSlIzYalXGfmHJgT6OLlGasMCLLlBW/WEtPtHR hrHFmkf8xRdyH7dALqSYcpq4P/aMCXhkV4dCfBDB2uX43/Nbi4IueH61fHtDxgVxeaH+ xKO3mHCOm8drD0fsMs4QiNwX+ndRihvlfDp21FjIE3kWoikvzM67voAAf+8f2/BaqnyK QKjA== X-Gm-Message-State: APf1xPDEIlroeAfR9elLU6GksvaxQOkk9gxzUYFfMXogfC711fk6X34+ nG30K9eDguGFBMEEHoS9DWqNyg== X-Received: by 10.157.39.36 with SMTP id r33mr3518887ota.321.1519255403103; Wed, 21 Feb 2018 15:23:23 -0800 (PST) Received: from aura.cortijodelrio.net (CableLink-187-161-113-185.PCs.InterCable.net. [187.161.113.185]) by smtp.googlemail.com with ESMTPSA id x27sm4738611ote.80.2018.02.21.15.23.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Feb 2018 15:23:21 -0800 (PST) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org Cc: andy.shevchenko@gmail.com, 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 v2] selftests: gpio: restructure Makefile Date: Wed, 21 Feb 2018 17:22:52 -0600 Message-Id: <1519255373-10071-1-git-send-email-daniel.diaz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519249964-1630-1-git-send-email-daniel.diaz@linaro.org> References: <1519249964-1630-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 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 --- v2: Add commit description tools/testing/selftests/gpio/Makefile | 36 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index 1bbb475..6890f61 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -1,31 +1,29 @@ # 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 -include ../lib.mk +GPIODIR := ../../../gpio +GPIOOBJ := gpio-utils.o +GPIOINC := gpio.h -all: $(BINARIES) +all: $(GPIOINC) $(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): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h +include ../lib.mk -../../../gpio/gpio-utils.o: - make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio +$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) -../../../../usr/include/linux/gpio.h: - make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/ +$(GPIODIR)/$(GPIOOBJ): + $(MAKE) -C $(GPIODIR) +$(GPIOINC): + $(MAKE) -C ../../../.. headers_install