xref: /linux/arch/nios2/Makefile (revision 8212f8986d311ccf6a72305e6bdbd814691701d6)
12fc8483fSLey Foon Tan#
22fc8483fSLey Foon Tan# This file is subject to the terms and conditions of the GNU General Public
32fc8483fSLey Foon Tan# License.  See the file "COPYING" in the main directory of this archive
42fc8483fSLey Foon Tan# for more details.
52fc8483fSLey Foon Tan#
62fc8483fSLey Foon Tan# Copyright (C) 2013 Altera Corporation
72fc8483fSLey Foon Tan# Copyright (C) 1994, 95, 96, 2003 by Wind River Systems
82fc8483fSLey Foon Tan# Written by Fredrik Markstrom
92fc8483fSLey Foon Tan#
102fc8483fSLey Foon Tan# This file is included by the global makefile so that you can add your own
11*8212f898SMasahiro Yamada# architecture-specific flags and dependencies.
122fc8483fSLey Foon Tan#
132fc8483fSLey Foon Tan# Nios2 port by Wind River Systems Inc trough:
142fc8483fSLey Foon Tan#   fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
152fc8483fSLey Foon Tan
16d1e4ef04SPaul BolleKBUILD_DEFCONFIG := 3c120_defconfig
17d1e4ef04SPaul Bolle
182fc8483fSLey Foon TanUTS_SYSNAME = Linux
192fc8483fSLey Foon Tan
202fc8483fSLey Foon Tanexport MMU
212fc8483fSLey Foon Tan
22fb75a2bbSMarek VasutLIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
232fc8483fSLey Foon Tan
24a89988a6SMarek VasutKBUILD_AFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
25a89988a6SMarek Vasut
262fc8483fSLey Foon TanKBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__
27a89988a6SMarek VasutKBUILD_CFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
282fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul)
292fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx)
302fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div)
3123460839SMarek VasutKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_BMX_SUPPORT),-mbmx,-mno-bmx)
32edebea98SMarek VasutKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_CDX_SUPPORT),-mcdx,-mno-cdx)
332fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_FPU_SUPPORT),-mcustom-fpu-cfg=60-1,)
342fc8483fSLey Foon Tan
352fc8483fSLey Foon TanKBUILD_CFLAGS += -fno-optimize-sibling-calls
362fc8483fSLey Foon TanKBUILD_CFLAGS += -DUTS_SYSNAME=\"$(UTS_SYSNAME)\"
372fc8483fSLey Foon TanKBUILD_CFLAGS += -fno-builtin
382fc8483fSLey Foon TanKBUILD_CFLAGS += -G 0
392fc8483fSLey Foon Tan
402fc8483fSLey Foon Tanhead-y		:= arch/nios2/kernel/head.o
412fc8483fSLey Foon Tanlibs-y		+= arch/nios2/lib/ $(LIBGCC)
422fc8483fSLey Foon Tancore-y		+= arch/nios2/kernel/ arch/nios2/mm/
432fc8483fSLey Foon Tancore-y		+= arch/nios2/platform/
442fc8483fSLey Foon Tan
452fc8483fSLey Foon TanINSTALL_PATH ?= /tftpboot
462fc8483fSLey Foon Tannios2-boot := arch/$(ARCH)/boot
472fc8483fSLey Foon TanBOOT_TARGETS = vmImage zImage
482fc8483fSLey Foon TanPHONY += $(BOOT_TARGETS) install
492fc8483fSLey Foon TanKBUILD_IMAGE := $(nios2-boot)/vmImage
502fc8483fSLey Foon Tan
511b4f9e2bSRob Herringcore-y	+= $(nios2-boot)/dts/
522fc8483fSLey Foon Tan
532fc8483fSLey Foon Tanall: vmImage
542fc8483fSLey Foon Tan
552fc8483fSLey Foon Tan$(BOOT_TARGETS): vmlinux
562fc8483fSLey Foon Tan	$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
572fc8483fSLey Foon Tan
582fc8483fSLey Foon Taninstall:
5989b4db61SMasahiro Yamada	sh $(srctree)/$(nios2-boot)/install.sh $(KERNELRELEASE) \
6089b4db61SMasahiro Yamada	$(KBUILD_IMAGE) System.map "$(INSTALL_PATH)"
612fc8483fSLey Foon Tan
622fc8483fSLey Foon Tandefine archhelp
632fc8483fSLey Foon Tan  echo  '* vmImage         - Kernel-only image for U-Boot ($(KBUILD_IMAGE))'
642fc8483fSLey Foon Tan  echo  '  install         - Install kernel using'
652fc8483fSLey Foon Tan  echo  '                     (your) ~/bin/$(INSTALLKERNEL) or'
662fc8483fSLey Foon Tan  echo  '                     (distribution) /sbin/$(INSTALLKERNEL) or'
672fc8483fSLey Foon Tan  echo  '                     install to $$(INSTALL_PATH)'
682fc8483fSLey Foon Tanendef
69