From patchwork Sun Jan 25 06:11:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 432464 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1EB3C1400F1 for ; Sun, 25 Jan 2015 17:13:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B99184B737; Sun, 25 Jan 2015 07:13:23 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LKhjN2PH7RQp; Sun, 25 Jan 2015 07:13:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3F6C04B779; Sun, 25 Jan 2015 07:13:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 289BA4B700 for ; Sun, 25 Jan 2015 07:13:03 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HE6UeM0bcv62 for ; Sun, 25 Jan 2015 07:13:03 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by theia.denx.de (Postfix) with ESMTPS id A4F534B6FC for ; Sun, 25 Jan 2015 07:12:59 +0100 (CET) Received: by mail-pa0-f44.google.com with SMTP id rd3so5521375pab.3 for ; Sat, 24 Jan 2015 22:12:58 -0800 (PST) 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=2TGHHppyvBV53YBEVxMo5G1cLJY32ABsSY8JdvQ3s4g=; b=M3UJD3rSD/PqNMbcBfAnKmTgl8mWSjYh7oymmTcOkeq0vFx2m7qXpvoJZmzuC/3Q0a 3QPg9C8vbdyrSsXUa7PWCMFwDXZz5tQQOBYgbBlsOcYYWhXGMpfotJk4HVaFyC1OzhtO c1K6RApjTqfZJdKBBRwPD6PShvwaQjz7lCl/MEV5gx1bufJ0LkXdWw3KGmQLNVUNEftN CR0hwHbKF8kDunjk3oWV7sCYnjFQOBRjU6sKYnHKykqnDI+mPgvj9g+X8cB4PRgIlaGk CIGLwAvSl988odor9/dqXcUOJYNTWBfj8DNWpJ5jYxTYpgDF04c5fwgmFgrgpl8W1efT 6tIg== X-Received: by 10.70.90.100 with SMTP id bv4mr24510738pdb.29.1422166378339; Sat, 24 Jan 2015 22:12:58 -0800 (PST) Received: from oscar.sesame (112.136.111.86.er.eaccess.ne.jp. [112.136.111.86]) by mx.google.com with ESMTPSA id sm4sm6438237pab.22.2015.01.24.22.12.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 Jan 2015 22:12:57 -0800 (PST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 25 Jan 2015 15:11:15 +0900 Message-Id: <1422166283-20822-14-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422166283-20822-1-git-send-email-yamada.m@jp.panasonic.com> References: <1422166283-20822-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Michal Marek , Tom Rini , Borislav Petkov Subject: [U-Boot] [RFC PATCH 13/21] kbuild: prepare for moving headers into mach-*/include/mach X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de In U-Boot, SoC-specific headers are placed in arch/$(ARCH)/include/asm/arch-$(SOC) and a symbolic link to that directory is created at the early stage of the build process. Creating and removing a symbolic link during the build is not preferred. In fact, Linux Kernel did away with include/asm-$(ARCH) directories a long time time ago. As for ARM, now it is possible to collect SoC sources into arch/arm/mach-$(SOC). It is also reasonable to move SoC headers into arch/arm/mach-$(SOC)/include/mach. This commit prepares for that. If the directory arch/$(ARCH)/mach-$(SOC)/include/mach exists, a symbolic to that directory is created. Otherwise, a symbolic link to arch/$(ARCH)/include/asm/arch-$(SOC) or arch-$(CPU) is created. Signed-off-by: Masahiro Yamada --- scripts/Makefile.autoconf | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf index 8e9d71f..58e1642 100644 --- a/scripts/Makefile.autoconf +++ b/scripts/Makefile.autoconf @@ -85,15 +85,26 @@ include/config.h: scripts/Makefile.autoconf create_symlink FORCE $(call filechk,config_h) # symbolic links +# If arch/$(ARCH)/mach-$(SOC)/include/mach exists, +# make a symbolic link to that directory. +# Otherwise, create a symbolic link to arch/$(ARCH)/include/asm/arch-$(SOC). PHONY += create_symlink create_symlink: ifneq ($(KBUILD_SRC),) $(Q)mkdir -p include/asm - $(Q)ln -fsn $(KBUILD_SRC)/arch/$(ARCH)/include/asm/arch-$(if $(SOC),$(SOC),$(CPU)) \ - include/asm/arch + $(Q)if [ -d $(KBUILD_SRC)/arch/$(ARCH)/mach-$(SOC)/include/mach ]; then \ + dest=arch/$(ARCH)/mach-$(SOC)/include/mach; \ + else \ + dest=arch/$(ARCH)/include/asm/arch-$(if $(SOC),$(SOC),$(CPU)); \ + fi; \ + ln -fsn $(KBUILD_SRC)/$$dest include/asm/arch else - $(Q)ln -fsn arch-$(if $(SOC),$(SOC),$(CPU)) \ - arch/$(ARCH)/include/asm/arch + $(Q)if [ -d arch/$(ARCH)/mach-$(SOC)/include/mach ]; then \ + dest=../../mach-$(SOC)/include/mach; \ + else \ + dest=arch-$(if $(SOC),$(SOC),$(CPU)); \ + fi; \ + ln -fsn $$dest arch/$(ARCH)/include/asm/arch endif PHONY += FORCE