162306a36Sopenharmony_ci#
262306a36Sopenharmony_ci# This file is subject to the terms and conditions of the GNU General Public
362306a36Sopenharmony_ci# License.  See the file "COPYING" in the main directory of this archive
462306a36Sopenharmony_ci# for more details.
562306a36Sopenharmony_ci#
662306a36Sopenharmony_ci# Copyright (C) 2013 Altera Corporation
762306a36Sopenharmony_ci# Copyright (C) 1994, 95, 96, 2003 by Wind River Systems
862306a36Sopenharmony_ci# Written by Fredrik Markstrom
962306a36Sopenharmony_ci#
1062306a36Sopenharmony_ci# This file is included by the global makefile so that you can add your own
1162306a36Sopenharmony_ci# architecture-specific flags and dependencies.
1262306a36Sopenharmony_ci#
1362306a36Sopenharmony_ci# Nios2 port by Wind River Systems Inc trough:
1462306a36Sopenharmony_ci#   fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciKBUILD_DEFCONFIG := 3c120_defconfig
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciUTS_SYSNAME = Linux
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciexport MMU
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ciLIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciKBUILD_AFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciKBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__
2762306a36Sopenharmony_ciKBUILD_CFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
2862306a36Sopenharmony_ciKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul)
2962306a36Sopenharmony_ciKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx)
3062306a36Sopenharmony_ciKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div)
3162306a36Sopenharmony_ciKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_BMX_SUPPORT),-mbmx,-mno-bmx)
3262306a36Sopenharmony_ciKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_CDX_SUPPORT),-mcdx,-mno-cdx)
3362306a36Sopenharmony_ciKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_FPU_SUPPORT),-mcustom-fpu-cfg=60-1,)
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciKBUILD_CFLAGS += -fno-optimize-sibling-calls
3662306a36Sopenharmony_ciKBUILD_CFLAGS += -DUTS_SYSNAME=\"$(UTS_SYSNAME)\"
3762306a36Sopenharmony_ciKBUILD_CFLAGS += -fno-builtin
3862306a36Sopenharmony_ciKBUILD_CFLAGS += -G 0
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_cilibs-y		+= arch/nios2/lib/ $(LIBGCC)
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciINSTALL_PATH ?= /tftpboot
4362306a36Sopenharmony_cinios2-boot := arch/$(ARCH)/boot
4462306a36Sopenharmony_ciBOOT_TARGETS = vmImage zImage
4562306a36Sopenharmony_ciPHONY += $(BOOT_TARGETS) install
4662306a36Sopenharmony_ciKBUILD_IMAGE := $(nios2-boot)/vmImage
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciall: vmImage
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci$(BOOT_TARGETS): vmlinux
5162306a36Sopenharmony_ci	$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ciinstall:
5462306a36Sopenharmony_ci	$(call cmd,install)
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_cidefine archhelp
5762306a36Sopenharmony_ci  echo  '* vmImage         - Kernel-only image for U-Boot ($(KBUILD_IMAGE))'
5862306a36Sopenharmony_ci  echo  '  install         - Install kernel using'
5962306a36Sopenharmony_ci  echo  '                     (your) ~/bin/$(INSTALLKERNEL) or'
6062306a36Sopenharmony_ci  echo  '                     (distribution) /sbin/$(INSTALLKERNEL) or'
6162306a36Sopenharmony_ci  echo  '                     install to $$(INSTALL_PATH)'
6262306a36Sopenharmony_ciendef
63