xref: /linux/arch/nios2/Makefile (revision fb75a2bb53a16069e2837ea1a4fa1bd99d636dd4)
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
112fc8483fSLey Foon Tan# architecture-specific flags and dependencies. Remember to do have actions
122fc8483fSLey Foon Tan# for "archclean" cleaning up for this architecture.
132fc8483fSLey Foon Tan#
142fc8483fSLey Foon Tan# Nios2 port by Wind River Systems Inc trough:
152fc8483fSLey Foon Tan#   fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
162fc8483fSLey Foon Tan
17d1e4ef04SPaul BolleKBUILD_DEFCONFIG := 3c120_defconfig
18d1e4ef04SPaul Bolle
192fc8483fSLey Foon TanUTS_SYSNAME = Linux
202fc8483fSLey Foon Tan
212fc8483fSLey Foon Tanexport MMU
222fc8483fSLey Foon Tan
23*fb75a2bbSMarek VasutLIBGCC         := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
242fc8483fSLey Foon Tan
252fc8483fSLey Foon TanKBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__
262fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul)
272fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx)
282fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div)
292fc8483fSLey Foon TanKBUILD_CFLAGS += $(if $(CONFIG_NIOS2_FPU_SUPPORT),-mcustom-fpu-cfg=60-1,)
302fc8483fSLey Foon Tan
312fc8483fSLey Foon TanKBUILD_CFLAGS += -fno-optimize-sibling-calls
322fc8483fSLey Foon TanKBUILD_CFLAGS += -DUTS_SYSNAME=\"$(UTS_SYSNAME)\"
332fc8483fSLey Foon TanKBUILD_CFLAGS += -fno-builtin
342fc8483fSLey Foon TanKBUILD_CFLAGS += -G 0
352fc8483fSLey Foon Tan
362fc8483fSLey Foon Tanhead-y		:= arch/nios2/kernel/head.o
372fc8483fSLey Foon Tanlibs-y		+= arch/nios2/lib/ $(LIBGCC)
382fc8483fSLey Foon Tancore-y		+= arch/nios2/kernel/ arch/nios2/mm/
392fc8483fSLey Foon Tancore-y		+= arch/nios2/platform/
402fc8483fSLey Foon Tan
412fc8483fSLey Foon TanINSTALL_PATH ?= /tftpboot
422fc8483fSLey Foon Tannios2-boot := arch/$(ARCH)/boot
432fc8483fSLey Foon TanBOOT_TARGETS = vmImage zImage
442fc8483fSLey Foon TanPHONY += $(BOOT_TARGETS) install
452fc8483fSLey Foon TanKBUILD_IMAGE := $(nios2-boot)/vmImage
462fc8483fSLey Foon Tan
472fc8483fSLey Foon Tanifneq ($(CONFIG_NIOS2_DTB_SOURCE),"")
482fc8483fSLey Foon Tan	core-y	+= $(nios2-boot)/
492fc8483fSLey Foon Tanendif
502fc8483fSLey Foon Tan
512fc8483fSLey Foon Tanall: vmImage
522fc8483fSLey Foon Tan
532fc8483fSLey Foon Tanarchclean:
542fc8483fSLey Foon Tan	$(Q)$(MAKE) $(clean)=$(nios2-boot)
552fc8483fSLey Foon Tan
562fc8483fSLey Foon Tan%.dtb:
572fc8483fSLey Foon Tan	$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
582fc8483fSLey Foon Tan
592fc8483fSLey Foon Tandtbs:
602fc8483fSLey Foon Tan	$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
612fc8483fSLey Foon Tan
622fc8483fSLey Foon Tan$(BOOT_TARGETS): vmlinux
632fc8483fSLey Foon Tan	$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
642fc8483fSLey Foon Tan
652fc8483fSLey Foon Taninstall:
662fc8483fSLey Foon Tan	$(Q)$(MAKE) $(build)=$(nios2-boot) BOOTIMAGE=$(KBUILD_IMAGE) install
672fc8483fSLey Foon Tan
682fc8483fSLey Foon Tandefine archhelp
692fc8483fSLey Foon Tan  echo  '* vmImage         - Kernel-only image for U-Boot ($(KBUILD_IMAGE))'
702fc8483fSLey Foon Tan  echo  '  install         - Install kernel using'
712fc8483fSLey Foon Tan  echo  '                     (your) ~/bin/$(INSTALLKERNEL) or'
722fc8483fSLey Foon Tan  echo  '                     (distribution) /sbin/$(INSTALLKERNEL) or'
732fc8483fSLey Foon Tan  echo  '                     install to $$(INSTALL_PATH)'
742fc8483fSLey Foon Tan  echo  '  dtbs            - Build device tree blobs for enabled boards'
752fc8483fSLey Foon Tanendef
76