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-04-29 05:15:09 +08:00
|
|
|
# FIXME: Disable use of global pointer for now, this isn't properly set up
|
|
|
|
# in our linker script.
|
|
|
|
arch_cflags := $(call cc-option,-G0)
|
|
|
|
|
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-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
|
|
|
|
|
|
|
KERNEL_HEX_NAME = $(KERNEL_NAME).hex
|
|
|
|
|
|
|
|
quiet_cmd_gen_hex = HEX $@
|
|
|
|
cmd_gen_hex = \
|
|
|
|
( \
|
|
|
|
$(OBJCOPY) -S -O ihex -R .note -R .comment -R COMMON -R .eh_frame $< $@; \
|
|
|
|
)
|
|
|
|
|
|
|
|
$(KERNEL_HEX_NAME): $(KERNEL_ELF_NAME)
|
|
|
|
$(call cmd,gen_hex)
|
|
|
|
|
|
|
|
zephyr: $(KERNEL_HEX_NAME)
|
|
|
|
all: $(KERNEL_HEX_NAME)
|
2016-05-27 05:45:52 +08:00
|
|
|
export KERNEL_HEX_NAME
|
2016-06-03 01:48:59 +08:00
|
|
|
|
|
|
|
QEMU_CPU_TYPE_nios2 = nios2
|
|
|
|
QEMU_FLAGS_nios2 = -machine altera_10m50_zephyr \
|
|
|
|
-serial stdio
|
|
|
|
QEMU_nios2 = qemu-system-nios2
|