2016-06-18 00:15:25 +08:00
|
|
|
-include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
|
2016-04-22 05:47:09 +08:00
|
|
|
|
2016-07-01 07:45:08 +08:00
|
|
|
ifdef CONFIG_GP_NONE
|
|
|
|
gpopt = none
|
|
|
|
else ifdef CONFIG_GP_LOCAL
|
|
|
|
gpopt = local
|
|
|
|
else ifdef CONFIG_GP_GLOBAL
|
|
|
|
gpopt = global
|
|
|
|
else ifdef CONFIG_GP_ALL_DATA
|
|
|
|
gpopt = data
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Set Global Pointer option based on Kconfig.
|
|
|
|
arch_cflags += -mgpopt=$(gpopt)
|
|
|
|
|
2016-04-29 05:16:00 +08:00
|
|
|
# Put functions and data in their own binary sections so that ld can
|
|
|
|
# garbage collect them
|
|
|
|
arch_cflags += $(call cc-option,-ffunction-sections) \
|
|
|
|
$(call cc-option,-fdata-sections)
|
|
|
|
|
2016-06-25 02:27:39 +08:00
|
|
|
# TODO Find a way to pull this out of system.h somehow
|
|
|
|
# instead of having Kconfig for it
|
|
|
|
ifdef CONFIG_HAS_MUL_INSTRUCTION
|
|
|
|
arch_cflags += -mhw-mul
|
|
|
|
else
|
|
|
|
arch_cflags += -mno-hw-mul
|
|
|
|
endif
|
|
|
|
ifdef CONFIG_HAS_MULX_INSTRUCTION
|
|
|
|
arch_cflags += -mhw-mulx
|
|
|
|
else
|
|
|
|
arch_cflags += -mno-hw-mulx
|
|
|
|
endif
|
|
|
|
ifdef CONFIG_HAS_DIV_INSTRUCTION
|
|
|
|
arch_cflags += -mhw-div
|
|
|
|
else
|
|
|
|
arch_cflags += -mno-hw-div
|
|
|
|
endif
|
|
|
|
|
2016-05-05 04:52:25 +08:00
|
|
|
# Nios II CPUs are configurable and we need to pull in the generated
|
|
|
|
# headers system.h and linker.h which specify what is enabled and where
|
|
|
|
# everything is.
|
2016-05-10 07:51:10 +08:00
|
|
|
soc_ld_include := -I$(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/include
|
|
|
|
arch_cflags += $(soc_ld_include)
|
|
|
|
EXTRA_LINKER_CMD_OPT += $(soc_ld_include)
|
2016-05-05 04:52:25 +08:00
|
|
|
|
2016-04-29 05:15:09 +08:00
|
|
|
KBUILD_AFLAGS += $(arch_cflags)
|
|
|
|
KBUILD_CFLAGS += $(arch_cflags)
|
|
|
|
KBUILD_CXXFLAGS += $(arch_cflags)
|
2016-05-26 23:32:04 +08:00
|
|
|
|
|
|
|
soc-cxxflags ?= $(soc-cflags)
|
|
|
|
soc-aflags ?= $(soc-cflags)
|
|
|
|
KBUILD_CFLAGS += $(soc-cflags)
|
|
|
|
KBUILD_CXXFLAGS += $(soc-cxxflags)
|
|
|
|
KBUILD_AFLAGS += $(soc-aflags)
|
2016-05-27 01:47:07 +08:00
|
|
|
|
|
|
|
zephyr: $(KERNEL_HEX_NAME)
|
|
|
|
all: $(KERNEL_HEX_NAME)
|
2016-06-03 01:48:59 +08:00
|
|
|
|
|
|
|
QEMU_CPU_TYPE_nios2 = nios2
|
2016-06-25 04:57:58 +08:00
|
|
|
QEMU_FLAGS_nios2 = -machine altera_10m50_zephyr -nographic
|
2016-06-03 01:48:59 +08:00
|
|
|
QEMU_nios2 = qemu-system-nios2
|