2015-08-23 23:22:40 +08:00
|
|
|
KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-sections,)
|
|
|
|
|
2016-04-03 21:37:43 +08:00
|
|
|
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
|
2015-08-23 23:22:40 +08:00
|
|
|
|
2016-01-13 20:49:42 +08:00
|
|
|
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
|
2015-08-23 23:22:40 +08:00
|
|
|
|
2016-05-27 00:13:30 +08:00
|
|
|
cflags-cortex-m0 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0) \
|
|
|
|
$(call cc-option,-mthumb -march=armv6-m)
|
|
|
|
cflags-cortex-m0+ = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0plus) \
|
|
|
|
$(call cc-option,-mthumb -march=armv6-m)
|
|
|
|
cflags-cortex-m1 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m1) \
|
|
|
|
$(call cc-option,-mthumb -march=armv6-m)
|
|
|
|
cflags-cortex-m3 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m3) \
|
|
|
|
$(call cc-option,-mthumb -march=armv7-m)
|
|
|
|
cflags-cortex-m4 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m4) \
|
|
|
|
$(call cc-option,-mthumb -march=armv7e-m)
|
2016-09-27 17:55:39 +08:00
|
|
|
cflags-cortex-m7 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m7)
|
2016-05-17 00:56:14 +08:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_FLOAT), y)
|
2016-06-30 03:42:09 +08:00
|
|
|
ifeq ($(CONFIG_FP_SOFTABI), y)
|
2016-05-17 00:56:14 +08:00
|
|
|
cflags-cortex-m4 += $(call cc-option,-mfloat-abi=softfp -mfpu=fpv4-sp-d16)
|
2016-09-27 17:55:39 +08:00
|
|
|
cflags-cortex-m7 += $(call cc-option,-mfloat-abi=softfp -mfpu=fpv5-d16)
|
2016-05-17 00:56:14 +08:00
|
|
|
endif
|
2016-06-30 03:42:09 +08:00
|
|
|
ifeq ($(CONFIG_FP_HARDABI), y)
|
|
|
|
cflags-cortex-m4 += $(call cc-option,-mfloat-abi=hard -mfpu=fpv4-sp-d16)
|
2016-09-27 17:55:39 +08:00
|
|
|
cflags-cortex-m7 += $(call cc-option,-mfloat-abi=hard -mfpu=fpv5-d16)
|
2016-06-30 03:42:09 +08:00
|
|
|
endif
|
|
|
|
endif
|
2016-05-17 00:56:14 +08:00
|
|
|
|
2016-10-06 06:43:36 +08:00
|
|
|
aflags-$(CONFIG_CPU_CORTEX_M0) += $(cflags-cortex-m0)
|
|
|
|
cflags-$(CONFIG_CPU_CORTEX_M0) += $(cflags-cortex-m0)
|
|
|
|
cxxflags-$(CONFIG_CPU_CORTEX_M0) += $(cflags-cortex-m0)
|
|
|
|
|
|
|
|
aflags-$(CONFIG_CPU_CORTEX_M0PLUS) += $(cflags-cortex-m0+)
|
|
|
|
cflags-$(CONFIG_CPU_CORTEX_M0PLUS) += $(cflags-cortex-m0+)
|
|
|
|
cxxflags-$(CONFIG_CPU_CORTEX_M0PLUS) += $(cflags-cortex-m0+)
|
|
|
|
|
2016-05-27 00:13:30 +08:00
|
|
|
aflags-$(CONFIG_CPU_CORTEX_M3) += $(cflags-cortex-m3)
|
|
|
|
cflags-$(CONFIG_CPU_CORTEX_M3) += $(cflags-cortex-m3)
|
|
|
|
cxxflags-$(CONFIG_CPU_CORTEX_M3) += $(cflags-cortex-m3)
|
|
|
|
|
|
|
|
aflags-$(CONFIG_CPU_CORTEX_M4) += $(cflags-cortex-m4)
|
|
|
|
cflags-$(CONFIG_CPU_CORTEX_M4) += $(cflags-cortex-m4)
|
|
|
|
cxxflags-$(CONFIG_CPU_CORTEX_M4) += $(cflags-cortex-m4)
|
|
|
|
|
2016-09-27 17:55:39 +08:00
|
|
|
aflags-$(CONFIG_CPU_CORTEX_M7) += $(cflags-cortex-m7)
|
|
|
|
cflags-$(CONFIG_CPU_CORTEX_M7) += $(cflags-cortex-m7)
|
|
|
|
cxxflags-$(CONFIG_CPU_CORTEX_M7) += $(cflags-cortex-m7)
|
2016-05-27 00:13:30 +08:00
|
|
|
|
|
|
|
KBUILD_AFLAGS += $(aflags-y)
|
2016-01-13 20:49:42 +08:00
|
|
|
KBUILD_CFLAGS += $(cflags-y)
|
|
|
|
KBUILD_CXXFLAGS += $(cflags-y)
|
2015-08-23 23:22:40 +08:00
|
|
|
|
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)
|
|
|
|
|