1*2fc8483fSLey Foon Tan# 2*2fc8483fSLey Foon Tan# This file is subject to the terms and conditions of the GNU General Public 3*2fc8483fSLey Foon Tan# License. See the file "COPYING" in the main directory of this archive 4*2fc8483fSLey Foon Tan# for more details. 5*2fc8483fSLey Foon Tan# 6*2fc8483fSLey Foon Tan# Copyright (C) 2013 Altera Corporation 7*2fc8483fSLey Foon Tan# Copyright (C) 1994, 95, 96, 2003 by Wind River Systems 8*2fc8483fSLey Foon Tan# Written by Fredrik Markstrom 9*2fc8483fSLey Foon Tan# 10*2fc8483fSLey Foon Tan# This file is included by the global makefile so that you can add your own 11*2fc8483fSLey Foon Tan# architecture-specific flags and dependencies. Remember to do have actions 12*2fc8483fSLey Foon Tan# for "archclean" cleaning up for this architecture. 13*2fc8483fSLey Foon Tan# 14*2fc8483fSLey Foon Tan# Nios2 port by Wind River Systems Inc trough: 15*2fc8483fSLey Foon Tan# fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com 16*2fc8483fSLey Foon Tan 17*2fc8483fSLey Foon TanUTS_SYSNAME = Linux 18*2fc8483fSLey Foon Tan 19*2fc8483fSLey Foon Tanexport MMU 20*2fc8483fSLey Foon Tan 21*2fc8483fSLey Foon TanLIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 22*2fc8483fSLey Foon Tan 23*2fc8483fSLey Foon TanKBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__ 24*2fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul) 25*2fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx) 26*2fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div) 27*2fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_FPU_SUPPORT),-mcustom-fpu-cfg=60-1,) 28*2fc8483fSLey Foon Tan 29*2fc8483fSLey Foon TanKBUILD_CFLAGS += -fno-optimize-sibling-calls 30*2fc8483fSLey Foon TanKBUILD_CFLAGS += -DUTS_SYSNAME=\"$(UTS_SYSNAME)\" 31*2fc8483fSLey Foon TanKBUILD_CFLAGS += -fno-builtin 32*2fc8483fSLey Foon TanKBUILD_CFLAGS += -G 0 33*2fc8483fSLey Foon Tan 34*2fc8483fSLey Foon Tanhead-y := arch/nios2/kernel/head.o 35*2fc8483fSLey Foon Tanlibs-y += arch/nios2/lib/ $(LIBGCC) 36*2fc8483fSLey Foon Tancore-y += arch/nios2/kernel/ arch/nios2/mm/ 37*2fc8483fSLey Foon Tancore-y += arch/nios2/platform/ 38*2fc8483fSLey Foon Tan 39*2fc8483fSLey Foon TanINSTALL_PATH ?= /tftpboot 40*2fc8483fSLey Foon Tannios2-boot := arch/$(ARCH)/boot 41*2fc8483fSLey Foon TanBOOT_TARGETS = vmImage zImage 42*2fc8483fSLey Foon TanPHONY += $(BOOT_TARGETS) install 43*2fc8483fSLey Foon TanKBUILD_IMAGE := $(nios2-boot)/vmImage 44*2fc8483fSLey Foon Tan 45*2fc8483fSLey Foon Tanifneq ($(CONFIG_NIOS2_DTB_SOURCE),"") 46*2fc8483fSLey Foon Tan core-y += $(nios2-boot)/ 47*2fc8483fSLey Foon Tanendif 48*2fc8483fSLey Foon Tan 49*2fc8483fSLey Foon Tanall: vmImage 50*2fc8483fSLey Foon Tan 51*2fc8483fSLey Foon Tanarchclean: 52*2fc8483fSLey Foon Tan $(Q)$(MAKE) $(clean)=$(nios2-boot) 53*2fc8483fSLey Foon Tan 54*2fc8483fSLey Foon Tan%.dtb: 55*2fc8483fSLey Foon Tan $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@ 56*2fc8483fSLey Foon Tan 57*2fc8483fSLey Foon Tandtbs: 58*2fc8483fSLey Foon Tan $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@ 59*2fc8483fSLey Foon Tan 60*2fc8483fSLey Foon Tan$(BOOT_TARGETS): vmlinux 61*2fc8483fSLey Foon Tan $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@ 62*2fc8483fSLey Foon Tan 63*2fc8483fSLey Foon Taninstall: 64*2fc8483fSLey Foon Tan $(Q)$(MAKE) $(build)=$(nios2-boot) BOOTIMAGE=$(KBUILD_IMAGE) install 65*2fc8483fSLey Foon Tan 66*2fc8483fSLey Foon Tandefine archhelp 67*2fc8483fSLey Foon Tan echo '* vmImage - Kernel-only image for U-Boot ($(KBUILD_IMAGE))' 68*2fc8483fSLey Foon Tan echo ' install - Install kernel using' 69*2fc8483fSLey Foon Tan echo ' (your) ~/bin/$(INSTALLKERNEL) or' 70*2fc8483fSLey Foon Tan echo ' (distribution) /sbin/$(INSTALLKERNEL) or' 71*2fc8483fSLey Foon Tan echo ' install to $$(INSTALL_PATH)' 72*2fc8483fSLey Foon Tan echo ' dtbs - Build device tree blobs for enabled boards' 73*2fc8483fSLey Foon Tanendef 74