From patchwork Fri Sep 5 06:48:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 4850161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4CD7E9F314 for ; Fri, 5 Sep 2014 06:51:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49A4F201FB for ; Fri, 5 Sep 2014 06:51:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 59A012017E for ; Fri, 5 Sep 2014 06:51:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XPnL0-0004ve-4X; Fri, 05 Sep 2014 06:49:38 +0000 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XPnKc-0004Oj-Uo for linux-arm-kernel@lists.infradead.org; Fri, 05 Sep 2014 06:49:16 +0000 Received: by mail-wi0-f179.google.com with SMTP id q5so2398203wiv.6 for ; Thu, 04 Sep 2014 23:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ekLFyKUN1NYntJFK/psLze7ayxttWJj2YM1XxRtEuR4=; b=X4+4fWsqLLz7KOfa+Nan8hrKNimyQOca4ZrNPN1HHwY7limk53b04pEaciMRwm3VKR QcM42+vcWECwG2TvXwCEyZzJLDkHwzrugrxZuPCFUUlvyftT+MdffWmLFRR2oPRSJzKD 1YLWJrZ7oU13aqw3l1qJbb5dLh/+EQ7Dg/eYTaDE4vRuvCwNB89QDEtP6ZWPbjFwf+oz rMwE+XPmu1XkNb79dqeoWfcDEO7pffV3D3WhadJ3NojiNKUMSeIoSMUlKY+n0xnkcOhj zGUWS36b/tWTb/baln0dAKxcvconU6r5azL4a62Qt5dNh7mQq5H6fWicnHo1YSeLEJti EkUA== X-Received: by 10.180.109.169 with SMTP id ht9mr1240022wib.1.1409899732739; Thu, 04 Sep 2014 23:48:52 -0700 (PDT) Received: from rric.localhost (g224199072.adsl.alicedsl.de. [92.224.199.72]) by mx.google.com with ESMTPSA id au4sm403541wjc.15.2014.09.04.23.48.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 23:48:52 -0700 (PDT) From: Robert Richter To: Olof Johansson , Rob Herring , Mark Rutland , Arnd Bergmann , Michal Marek Subject: [PATCH 2/6] dts, kbuild: Factor out dtbs install rules to Makefile.dtbinst Date: Fri, 5 Sep 2014 08:48:08 +0200 Message-Id: <1409899692-1455-3-git-send-email-rric@kernel.org> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1409899692-1455-1-git-send-email-rric@kernel.org> References: <1409899692-1455-1-git-send-email-rric@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140904_234915_328101_79C687FA X-CRM114-Status: GOOD ( 12.47 ) X-Spam-Score: -0.7 (/) Cc: Robert Richter , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Richter Move dtbs install rules to Makefile.dtbinst. This change is needed to implement support for dts vendor subdirs. The change makes Makefiles easier and smaller as no longer the dtbs_install rule needs to be defined. Another advantage is that install goals are not encoded in targets anymore (%.dtb_dtbinst_). Signed-off-by: Robert Richter --- arch/arm/Makefile | 6 +++++- arch/arm/boot/dts/Makefile | 2 -- arch/arm64/Makefile | 6 +++++- arch/arm64/boot/dts/Makefile | 2 -- scripts/Kbuild.include | 6 ++++++ scripts/Makefile.dtbinst | 38 ++++++++++++++++++++++++++++++++++++++ scripts/Makefile.lib | 12 ------------ 7 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 scripts/Makefile.dtbinst diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 0ce9d0f71f2a..1963d9a9a2c4 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -313,9 +313,13 @@ $(BOOT_TARGETS): vmlinux $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ PHONY += dtbs dtbs_install -dtbs dtbs_install: prepare scripts + +dtbs: prepare scripts $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@ +dtbs_install: + $(Q)$(MAKE) $(dtbinst)=$(boot)/dts MACHINE=$(MACHINE) + # We use MRPROPER_FILES and CLEAN_FILES now archclean: $(Q)$(MAKE) $(clean)=$(boot) diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index b8c5cd3ddeb9..ab40afb87fb2 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -502,5 +502,3 @@ dtbs: $(addprefix $(obj)/, $(dtb-y)) $(Q)rm -f $(obj)/../*.dtb clean-files := *.dtb - -dtbs_install: $(addsuffix _dtbinst_, $(dtb-y)) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index e0a8292bc832..1627861e9bbd 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -72,9 +72,13 @@ zinstall install: vmlinux $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ PHONY += dtbs dtbs_install -dtbs dtbs_install: prepare scripts + +dtbs: prepare scripts $(Q)$(MAKE) $(build)=$(boot)/dts $@ +dtbs_install: + $(Q)$(MAKE) $(dtbinst)=$(boot)/dts + PHONY += vdso_install vdso_install: $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@ diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index 82e1c4cf8780..0a14c3828301 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile @@ -7,5 +7,3 @@ targets += $(dtb-y) dtbs: $(addprefix $(obj)/, $(dtb-y)) clean-files := *.dtb - -dtbs_install: $(addsuffix _dtbinst_, $(dtb-y)) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 8a9a4e1c7eab..861f5b4d48a2 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -179,6 +179,12 @@ build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj # $(Q)$(MAKE) $(modbuiltin)=dir modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj +### +# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj= +# Usage: +# $(Q)$(MAKE) $(dtbinst)=dir +dtbinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.dtbinst obj + # Prefix -I with $(srctree) if it is not an absolute path. # skip if -I has no parameter addtree = $(if $(patsubst -I%,%,$(1)), \ diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst new file mode 100644 index 000000000000..54286cccc289 --- /dev/null +++ b/scripts/Makefile.dtbinst @@ -0,0 +1,38 @@ +# ========================================================================== +# Installing dtb files +# +# Installs all dtb files listed in $(dtb-y) either in the +# INSTALL_DTBS_PATH directory or the default location: +# +# $INSTALL_PATH/dtbs/$KERNELRELEASE +# +# ========================================================================== + +src := $(obj) + +PHONY := __dtbs_install +__dtbs_install: + +include include/config/auto.conf +include scripts/Kbuild.include +include $(srctree)/$(obj)/Makefile + +PHONY += __dtbs_install_prep +__dtbs_install_prep: + $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi + $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi + $(Q)mkdir -p $(INSTALL_DTBS_PATH) + +dtbinst-files := $(dtb-y) + +# Helper targets for Installing DTBs into the boot directory +quiet_cmd_dtb_install = INSTALL $< + cmd_dtb_install = cp $< $(2) + +$(dtbinst-files): %.dtb: $(obj)/%.dtb | __dtbs_install_prep + $(call cmd,dtb_install,$(INSTALL_DTBS_PATH)) + +PHONY += $(dtbinst-files) +__dtbs_install: $(dtbinst-files) + +.PHONY: $(PHONY) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 260bf8acfce9..83a453794266 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -274,18 +274,6 @@ $(obj)/%.dtb: $(src)/%.dts FORCE dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) -# Helper targets for Installing DTBs into the boot directory -quiet_cmd_dtb_install = INSTALL $< - cmd_dtb_install = cp $< $(2) - -_dtbinst_pre_: - $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi - $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi - $(Q)mkdir -p $(INSTALL_DTBS_PATH) - -%.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_ - $(call cmd,dtb_install,$(INSTALL_DTBS_PATH)) - # Bzip2 # ---------------------------------------------------------------------------