xref: /linux/arch/nios2/Makefile (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
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
118212f898SMasahiro 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 Tanlibs-y		+= arch/nios2/lib/ $(LIBGCC)
412fc8483fSLey Foon Tan
422fc8483fSLey Foon TanINSTALL_PATH ?= /tftpboot
432fc8483fSLey Foon Tannios2-boot := arch/$(ARCH)/boot
442fc8483fSLey Foon TanBOOT_TARGETS = vmImage zImage
452fc8483fSLey Foon TanPHONY += $(BOOT_TARGETS) install
462fc8483fSLey Foon TanKBUILD_IMAGE := $(nios2-boot)/vmImage
472fc8483fSLey Foon Tan
482fc8483fSLey Foon Tanall: vmImage
492fc8483fSLey Foon Tan
502fc8483fSLey Foon Tan$(BOOT_TARGETS): vmlinux
512fc8483fSLey Foon Tan	$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
522fc8483fSLey Foon Tan
532fc8483fSLey Foon Taninstall:
54*f774f5bbSMasahiro Yamada	$(call cmd,install)
552fc8483fSLey Foon Tan
562fc8483fSLey Foon Tandefine archhelp
572fc8483fSLey Foon Tan  echo  '* vmImage         - Kernel-only image for U-Boot ($(KBUILD_IMAGE))'
582fc8483fSLey Foon Tan  echo  '  install         - Install kernel using'
592fc8483fSLey Foon Tan  echo  '                     (your) ~/bin/$(INSTALLKERNEL) or'
602fc8483fSLey Foon Tan  echo  '                     (distribution) /sbin/$(INSTALLKERNEL) or'
612fc8483fSLey Foon Tan  echo  '                     install to $$(INSTALL_PATH)'
622fc8483fSLey Foon Tanendef
63