2014-11-06 15:20:19 +08:00
|
|
|
#
|
|
|
|
# This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
# License. See the file "COPYING" in the main directory of this archive
|
|
|
|
# for more details.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2013 Altera Corporation
|
|
|
|
# Copyright (C) 1994, 95, 96, 2003 by Wind River Systems
|
|
|
|
# Written by Fredrik Markstrom
|
|
|
|
#
|
|
|
|
# This file is included by the global makefile so that you can add your own
|
2021-10-13 14:36:22 +08:00
|
|
|
# architecture-specific flags and dependencies.
|
2014-11-06 15:20:19 +08:00
|
|
|
#
|
|
|
|
# Nios2 port by Wind River Systems Inc trough:
|
|
|
|
# fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com
|
|
|
|
|
2014-12-11 10:49:36 +08:00
|
|
|
KBUILD_DEFCONFIG := 3c120_defconfig
|
|
|
|
|
2014-11-06 15:20:19 +08:00
|
|
|
UTS_SYSNAME = Linux
|
|
|
|
|
|
|
|
export MMU
|
|
|
|
|
2016-05-17 14:01:18 +08:00
|
|
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
|
2014-11-06 15:20:19 +08:00
|
|
|
|
2017-04-19 19:19:00 +08:00
|
|
|
KBUILD_AFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
|
|
|
|
|
2014-11-06 15:20:19 +08:00
|
|
|
KBUILD_CFLAGS += -pipe -D__linux__ -D__ELF__
|
2017-04-19 19:19:00 +08:00
|
|
|
KBUILD_CFLAGS += -march=r$(CONFIG_NIOS2_ARCH_REVISION)
|
2014-11-06 15:20:19 +08:00
|
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MUL_SUPPORT),-mhw-mul,-mno-hw-mul)
|
|
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_MULX_SUPPORT),-mhw-mulx,-mno-hw-mulx)
|
|
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_HW_DIV_SUPPORT),-mhw-div,-mno-hw-div)
|
2017-04-19 19:19:01 +08:00
|
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_BMX_SUPPORT),-mbmx,-mno-bmx)
|
2017-04-19 19:19:02 +08:00
|
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_CDX_SUPPORT),-mcdx,-mno-cdx)
|
2014-11-06 15:20:19 +08:00
|
|
|
KBUILD_CFLAGS += $(if $(CONFIG_NIOS2_FPU_SUPPORT),-mcustom-fpu-cfg=60-1,)
|
|
|
|
|
|
|
|
KBUILD_CFLAGS += -fno-optimize-sibling-calls
|
|
|
|
KBUILD_CFLAGS += -DUTS_SYSNAME=\"$(UTS_SYSNAME)\"
|
|
|
|
KBUILD_CFLAGS += -fno-builtin
|
|
|
|
KBUILD_CFLAGS += -G 0
|
|
|
|
|
|
|
|
head-y := arch/nios2/kernel/head.o
|
|
|
|
libs-y += arch/nios2/lib/ $(LIBGCC)
|
|
|
|
core-y += arch/nios2/kernel/ arch/nios2/mm/
|
|
|
|
core-y += arch/nios2/platform/
|
|
|
|
|
|
|
|
INSTALL_PATH ?= /tftpboot
|
|
|
|
nios2-boot := arch/$(ARCH)/boot
|
|
|
|
BOOT_TARGETS = vmImage zImage
|
|
|
|
PHONY += $(BOOT_TARGETS) install
|
|
|
|
KBUILD_IMAGE := $(nios2-boot)/vmImage
|
|
|
|
|
2018-08-02 04:14:12 +08:00
|
|
|
core-y += $(nios2-boot)/dts/
|
2014-11-06 15:20:19 +08:00
|
|
|
|
|
|
|
all: vmImage
|
|
|
|
|
|
|
|
$(BOOT_TARGETS): vmlinux
|
|
|
|
$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@
|
|
|
|
|
|
|
|
install:
|
2021-07-29 22:07:06 +08:00
|
|
|
sh $(srctree)/$(nios2-boot)/install.sh $(KERNELRELEASE) \
|
|
|
|
$(KBUILD_IMAGE) System.map "$(INSTALL_PATH)"
|
2014-11-06 15:20:19 +08:00
|
|
|
|
|
|
|
define archhelp
|
|
|
|
echo '* vmImage - Kernel-only image for U-Boot ($(KBUILD_IMAGE))'
|
|
|
|
echo ' install - Install kernel using'
|
|
|
|
echo ' (your) ~/bin/$(INSTALLKERNEL) or'
|
|
|
|
echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
|
|
|
|
echo ' install to $$(INSTALL_PATH)'
|
|
|
|
endef
|