Back to home page

LXR

 
 

    


0001 #
0002 # This file is subject to the terms and conditions of the GNU General Public
0003 # License.  See the file "COPYING" in the main directory of this archive
0004 # for more details.
0005 #
0006 # Copyright (C) 2013 Altera Corporation
0007 # Copyright (C) 1994, 95, 96, 2003 by Wind River Systems
0008 # Written by Fredrik Markstrom
0009 #
0010 # This file is included by the global makefile so that you can add your own
0011 # architecture-specific flags and dependencies. Remember to do have actions
0012 # for "archclean" cleaning up for this architecture.
0013 #
0014 # Nios2 port by Wind River Systems Inc trough:
0015 #   fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
0016 
0017 KBUILD_DEFCONFIG := 3c120_defconfig
0018 
0019 UTS_SYSNAME = Linux
0020 
0021 export MMU
0022 
0023 LIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
0024 
0025 KBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__
0026 KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul)
0027 KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx)
0028 KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div)
0029 KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_FPU_SUPPORT),-mcustom-fpu-cfg=60-1,)
0030 
0031 KBUILD_CFLAGS += -fno-optimize-sibling-calls
0032 KBUILD_CFLAGS += -DUTS_SYSNAME=\"$(UTS_SYSNAME)\"
0033 KBUILD_CFLAGS += -fno-builtin
0034 KBUILD_CFLAGS += -G 0
0035 
0036 head-y          := arch/nios2/kernel/head.o
0037 libs-y          += arch/nios2/lib/ $(LIBGCC)
0038 core-y          += arch/nios2/kernel/ arch/nios2/mm/
0039 core-y          += arch/nios2/platform/
0040 
0041 INSTALL_PATH ?= /tftpboot
0042 nios2-boot := arch/$(ARCH)/boot
0043 BOOT_TARGETS = vmImage zImage
0044 PHONY += $(BOOT_TARGETS) install
0045 KBUILD_IMAGE := $(nios2-boot)/vmImage
0046 
0047 ifneq ($(CONFIG_NIOS2_DTB_SOURCE),"")
0048         core-y  += $(nios2-boot)/
0049 endif
0050 
0051 all: vmImage
0052 
0053 archclean:
0054         $(Q)$(MAKE) $(clean)=$(nios2-boot)
0055 
0056 %.dtb: | scripts
0057         $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
0058 
0059 dtbs:
0060         $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
0061 
0062 $(BOOT_TARGETS): vmlinux
0063         $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
0064 
0065 install:
0066         $(Q)$(MAKE) $(build)=$(nios2-boot) BOOTIMAGE=$(KBUILD_IMAGE) install
0067 
0068 define archhelp
0069   echo  '* vmImage         - Kernel-only image for U-Boot ($(KBUILD_IMAGE))'
0070   echo  '  install         - Install kernel using'
0071   echo  '                     (your) ~/bin/$(INSTALLKERNEL) or'
0072   echo  '                     (distribution) /sbin/$(INSTALLKERNEL) or'
0073   echo  '                     install to $$(INSTALL_PATH)'
0074   echo  '  dtbs            - Build device tree blobs for enabled boards'
0075 endef