mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
37c8a5fafa
There is nothing arch specific about building dtb files other than their location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. The dependencies and supported targets are all slightly different. Also, a cross-compiler for each arch is needed, but really the host compiler preprocessor is perfectly fine for building dtbs. Move the build rules to a common location and remove the arch specific ones. This is done in a single step to avoid warnings about overriding rules. The build dependencies had been a mixture of 'scripts' and/or 'prepare'. These pull in several dependencies some of which need a target compiler (specifically devicetable-offsets.h) and aren't needed to build dtbs. All that is really needed is dtc, so adjust the dependencies to only be dtc. This change enables support 'dtbs_install' on some arches which were missing the target. Acked-by: Will Deacon <will.deacon@arm.com> Acked-by: Paul Burton <paul.burton@mips.com> Acked-by: Ley Foon Tan <ley.foon.tan@intel.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Michal Marek <michal.lkml@markovi.net> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Michal Simek <monstr@monstr.eu> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Chris Zankel <chris@zankel.net> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: linux-kbuild@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: uclinux-h8-devel@lists.sourceforge.jp Cc: linux-mips@linux-mips.org Cc: nios2-dev@lists.rocketboards.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-xtensa@linux-xtensa.org Signed-off-by: Rob Herring <robh@kernel.org>
72 lines
2.4 KiB
Makefile
72 lines
2.4 KiB
Makefile
#
|
|
# This file is subject to the terms and conditions of the GNU General Public
|
|
# License. See the file "COPYING" in the main directory of this archive
|
|
# for more details.
|
|
#
|
|
# Copyright (C) 2013 Altera Corporation
|
|
# Copyright (C) 1994, 95, 96, 2003 by Wind River Systems
|
|
# Written by Fredrik Markstrom
|
|
#
|
|
# This file is included by the global makefile so that you can add your own
|
|
# architecture-specific flags and dependencies. Remember to do have actions
|
|
# for "archclean" cleaning up for this architecture.
|
|
#
|
|
# Nios2 port by Wind River Systems Inc trough:
|
|
# fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
|
|
|
|
KBUILD_DEFCONFIG := 3c120_defconfig
|
|
|
|
UTS_SYSNAME = Linux
|
|
|
|
export MMU
|
|
|
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
|
|
|
|
KBUILD_AFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
|
|
|
|
KBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__
|
|
KBUILD_CFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul)
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx)
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div)
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_BMX_SUPPORT),-mbmx,-mno-bmx)
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_CDX_SUPPORT),-mcdx,-mno-cdx)
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_FPU_SUPPORT),-mcustom-fpu-cfg=60-1,)
|
|
|
|
KBUILD_CFLAGS += -fno-optimize-sibling-calls
|
|
KBUILD_CFLAGS += -DUTS_SYSNAME=\"$(UTS_SYSNAME)\"
|
|
KBUILD_CFLAGS += -fno-builtin
|
|
KBUILD_CFLAGS += -G 0
|
|
|
|
head-y := arch/nios2/kernel/head.o
|
|
libs-y += arch/nios2/lib/ $(LIBGCC)
|
|
core-y += arch/nios2/kernel/ arch/nios2/mm/
|
|
core-y += arch/nios2/platform/
|
|
|
|
INSTALL_PATH ?= /tftpboot
|
|
nios2-boot := arch/$(ARCH)/boot
|
|
BOOT_TARGETS = vmImage zImage
|
|
PHONY += $(BOOT_TARGETS) install
|
|
KBUILD_IMAGE := $(nios2-boot)/vmImage
|
|
|
|
core-y += $(nios2-boot)/dts/
|
|
|
|
all: vmImage
|
|
|
|
archclean:
|
|
$(Q)$(MAKE) $(clean)=$(nios2-boot)
|
|
|
|
$(BOOT_TARGETS): vmlinux
|
|
$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
|
|
|
|
install:
|
|
$(Q)$(MAKE) $(build)=$(nios2-boot) BOOTIMAGE=$(KBUILD_IMAGE) install
|
|
|
|
define archhelp
|
|
echo '* vmImage - Kernel-only image for U-Boot ($(KBUILD_IMAGE))'
|
|
echo ' install - Install kernel using'
|
|
echo ' (your) ~/bin/$(INSTALLKERNEL) or'
|
|
echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
|
|
echo ' install to $$(INSTALL_PATH)'
|
|
endef
|