new SoC naming convention
Use SOC_FAMILY and SOC_SERIES to identify soc families and series and to point to the correct linker files and files related to a specific SoC. Change-Id: I8b1a7339f37d6ea4161d03073d36557a40c0b4a6 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
a02c34ef0b
commit
d2f1c76686
8 changed files with 18 additions and 11 deletions
14
Makefile
14
Makefile
|
@ -345,19 +345,22 @@ endif
|
|||
USERINCLUDE := -include $(CURDIR)/include/generated/autoconf.h
|
||||
|
||||
SOC_NAME = $(subst $(DQUOTE),,$(CONFIG_SOC))
|
||||
SOC_SERIES = $(subst $(DQUOTE),,$(CONFIG_SOC_SERIES))
|
||||
SOC_FAMILY = $(subst $(DQUOTE),,$(CONFIG_SOC_FAMILY))
|
||||
|
||||
override ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
|
||||
BOARD_NAME = $(subst $(DQUOTE),,$(CONFIG_BOARD))
|
||||
KERNEL_NAME = $(subst $(DQUOTE),,$(CONFIG_KERNEL_BIN_NAME))
|
||||
KERNEL_ELF_NAME = $(KERNEL_NAME).elf
|
||||
KERNEL_BIN_NAME = $(KERNEL_NAME).bin
|
||||
|
||||
export SOC_FAMILY SOC_NAME BOARD_NAME ARCH KERNEL_NAME KERNEL_ELF_NAME KERNEL_BIN_NAME
|
||||
export SOC_FAMILY SOC_SERIES SOC_PATH SOC_NAME BOARD_NAME
|
||||
export ARCH KERNEL_NAME KERNEL_ELF_NAME KERNEL_BIN_NAME
|
||||
# Use ZEPHYRINCLUDE when you must reference the include/ directory.
|
||||
# Needed to be compatible with the O= option
|
||||
ZEPHYRINCLUDE = \
|
||||
-I$(srctree)/arch/$(ARCH)/include \
|
||||
-I$(srctree)/arch/$(ARCH)/soc/$(SOC_NAME) \
|
||||
-I$(srctree)/arch/$(ARCH)/soc/$(SOC_PATH) \
|
||||
-I$(srctree)/boards/$(BOARD_NAME) \
|
||||
$(if $(KBUILD_SRC), -I$(srctree)/include) \
|
||||
-I$(srctree)/include \
|
||||
|
@ -625,6 +628,11 @@ KBUILD_CFLAGS += $(subst $(DQUOTE),,$(CONFIG_COMPILER_OPT))
|
|||
|
||||
export LDFLAG_LINKERCMD
|
||||
|
||||
ifeq ($(SOC_SERIES),)
|
||||
SOC_PATH = $(SOC_NAME)
|
||||
else
|
||||
SOC_PATH = $(SOC_FAMILY)/$(SOC_SERIES)
|
||||
endif
|
||||
include arch/$(ARCH)/Makefile
|
||||
|
||||
KBUILD_CFLAGS += $(CFLAGS)
|
||||
|
@ -705,7 +713,7 @@ KBUILD_LDS := $(srctree)/boards/$(BOARD_NAME)/linker.cmd
|
|||
|
||||
# If not available, try an SoC specific linker file
|
||||
ifeq ($(wildcard $(KBUILD_LDS)),)
|
||||
KBUILD_LDS := $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/linker.cmd
|
||||
KBUILD_LDS := $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/linker.cmd
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -2,5 +2,5 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers
|
|||
subdir-ccflags-y +=-I$(srctree)/drivers
|
||||
subdir-asflags-y += $(subdir-ccflags-y)
|
||||
|
||||
obj-y += soc/$(SOC_NAME)/
|
||||
obj-y += soc/$(SOC_PATH)/
|
||||
obj-y += core/
|
||||
|
|
|
@ -2,7 +2,7 @@ cflags-y += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-secti
|
|||
cflags-$(CONFIG_ARC_STACK_CHECKING) = $(call cc-option,-fomit-frame-pointer)
|
||||
cflags-$(CONFIG_LTO) = $(call cc-option,-flto,)
|
||||
|
||||
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile
|
||||
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
|
||||
|
||||
KBUILD_CFLAGS += $(cflags-y)
|
||||
KBUILD_CXXFLAGS += $(cflags-y)
|
||||
|
|
|
@ -2,5 +2,5 @@ subdir-ccflags-y +=-I$(srctree)/include/drivers
|
|||
subdir-ccflags-y +=-I$(srctree)/drivers
|
||||
subdir-asflags-y := ${subdir-ccflags-y}
|
||||
|
||||
obj-y += soc/$(SOC_NAME)/
|
||||
obj-y += soc/$(SOC_PATH)/
|
||||
obj-y += core/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-sections,)
|
||||
|
||||
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile
|
||||
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
|
||||
|
||||
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
ccflags-y +=-I$(srctree)/include/drivers
|
||||
ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(SOC_NAME)
|
||||
ccflags-y +=-I$(srctree)/arch/arm/soc/$(SOC_PATH)
|
||||
|
||||
asflags-y = $(ccflags-y)
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
obj-y += core/
|
||||
obj-y += soc/$(SOC_NAME)/
|
||||
|
||||
obj-$(CONFIG_GDB_SERVER) += debug/
|
||||
obj-y += soc/$(SOC_PATH)/
|
||||
|
|
|
@ -20,7 +20,7 @@ ifneq ($(CONFIG_SSE_FP_MATH),y)
|
|||
cflags-y += -mno-sse
|
||||
endif
|
||||
|
||||
include $(srctree)/arch/$(ARCH)/soc/$(SOC_NAME)/Makefile
|
||||
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
|
||||
|
||||
KBUILD_CXXFLAGS += $(cflags-y)
|
||||
KBUILD_CFLAGS += $(cflags-y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue