mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Merged in alinjerpelea/nuttx (pull request #1015)
tools: unix: add support for common board folder
* tools: unix: add support for common board folder
this patch adds support for a common board folder and simplifies the code
and maintenance on boards that share the same code
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* cxd56xx: migration to a common folder
This is the first platform to be migrated to the new common folder
structure.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
cc945b00e0
commit
3ed844640d
@@ -0,0 +1,4 @@
|
|||||||
|
#
|
||||||
|
# For a description of the syntax of this configuration file,
|
||||||
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
|
#
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
############################################################################
|
||||||
|
# boards/arm/cxd56x/spresense/src/Makefile
|
||||||
|
#
|
||||||
|
# Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
-include $(TOPDIR)/Make.defs
|
||||||
|
|
||||||
|
include board$(DELIM)Make.defs
|
||||||
|
include src$(DELIM)Make.defs
|
||||||
|
|
||||||
|
include $(TOPDIR)/boards/Board.mk
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
############################################################################
|
||||||
|
# boards/arm/cxd56x/spresense/common/Make.defs
|
||||||
|
#
|
||||||
|
# Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
DEPPATH += --dep-path src
|
||||||
|
VPATH += :src
|
||||||
|
CFLAGS += $(shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src)
|
||||||
+4
-9
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/arm/cxd56x/spresense/src/Makefile
|
# boards/arm/cxd56x/spresense/src/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright 2018 Sony Semiconductor Solutions Corporation
|
# Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||||
#
|
#
|
||||||
@@ -32,13 +32,6 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
-include $(TOPDIR)/Make.defs
|
|
||||||
|
|
||||||
DEPPATH = --dep-path .
|
|
||||||
|
|
||||||
ASRCS =
|
|
||||||
CSRCS =
|
|
||||||
|
|
||||||
CSRCS += cxd56_main.c
|
CSRCS += cxd56_main.c
|
||||||
CSRCS += cxd56_boot.c
|
CSRCS += cxd56_boot.c
|
||||||
CSRCS += cxd56_clock.c
|
CSRCS += cxd56_clock.c
|
||||||
@@ -133,4 +126,6 @@ ifeq ($(CONFIG_LCD_ILI9340),y)
|
|||||||
CSRCS += cxd56_ili9340.c
|
CSRCS += cxd56_ili9340.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(TOPDIR)/boards/Board.mk
|
DEPPATH += --dep-path board
|
||||||
|
VPATH += :board
|
||||||
|
CFLAGS += $(shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)
|
||||||
@@ -80,6 +80,7 @@ endif
|
|||||||
else
|
else
|
||||||
BOARD_DIR = $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)
|
BOARD_DIR = $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)
|
||||||
endif
|
endif
|
||||||
|
COMMON_DIR = $(if $(wildcard $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP)/common/Makefile),y,)
|
||||||
|
|
||||||
# CONFIG_APPS_DIR can be over-ridden from the command line or in the .config file.
|
# CONFIG_APPS_DIR can be over-ridden from the command line or in the .config file.
|
||||||
# The default value of CONFIG_APPS_DIR is ../apps. Ultimately, the application
|
# The default value of CONFIG_APPS_DIR is ../apps. Ultimately, the application
|
||||||
@@ -320,11 +321,22 @@ include/arch/board: include/arch
|
|||||||
@echo "LN: include/arch/board to $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/include"
|
@echo "LN: include/arch/board to $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/include"
|
||||||
$(Q) $(DIRLINK) $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/include include/arch/board
|
$(Q) $(DIRLINK) $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/include include/arch/board
|
||||||
|
|
||||||
|
ifeq ($(COMMON_DIR),y)
|
||||||
|
# Link the boards/<arch>/<chip>/common dir to arch/<arch-name>/src/board
|
||||||
# Link the boards/<arch>/<chip>/<board>/src dir to arch/<arch-name>/src/board
|
# Link the boards/<arch>/<chip>/<board>/src dir to arch/<arch-name>/src/board
|
||||||
|
|
||||||
|
$(ARCH_SRC)/board: .config
|
||||||
|
@echo "LN: $(ARCH_SRC)/board to $(BOARD_DIR)/common"
|
||||||
|
$(Q) $(DIRLINK) $(BOARD_DIR)/common $(ARCH_SRC)/board
|
||||||
|
@echo "LN: $(ARCH_SRC)/board/board to $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src"
|
||||||
|
$(Q) $(DIRLINK) $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src $(ARCH_SRC)/board/board
|
||||||
|
else
|
||||||
|
# Link the boards/<arch>/<chip>/<board>/src dir to arch/<arch-name>/src/boar
|
||||||
|
|
||||||
$(ARCH_SRC)/board: .config
|
$(ARCH_SRC)/board: .config
|
||||||
@echo "LN: $(ARCH_SRC)/board to $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src"
|
@echo "LN: $(ARCH_SRC)/board to $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src"
|
||||||
$(Q) $(DIRLINK) $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src $(ARCH_SRC)/board
|
$(Q) $(DIRLINK) $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src $(ARCH_SRC)/board
|
||||||
|
endif
|
||||||
|
|
||||||
# Link the boards/<arch>/<chip>/drivers dir to drivers/platform
|
# Link the boards/<arch>/<chip>/drivers dir to drivers/platform
|
||||||
|
|
||||||
@@ -380,6 +392,7 @@ clean_context:
|
|||||||
$(Q) $(DIRUNLINK) include/arch/board
|
$(Q) $(DIRUNLINK) include/arch/board
|
||||||
$(Q) $(DIRUNLINK) include/arch/chip
|
$(Q) $(DIRUNLINK) include/arch/chip
|
||||||
$(Q) $(DIRUNLINK) include/arch
|
$(Q) $(DIRUNLINK) include/arch
|
||||||
|
$(Q) $(DIRUNLINK) $(ARCH_SRC)/board/board
|
||||||
$(Q) $(DIRUNLINK) $(ARCH_SRC)/board
|
$(Q) $(DIRUNLINK) $(ARCH_SRC)/board
|
||||||
$(Q) $(DIRUNLINK) $(ARCH_SRC)/chip
|
$(Q) $(DIRUNLINK) $(ARCH_SRC)/chip
|
||||||
$(Q) $(DIRUNLINK) $(TOPDIR)/drivers/platform
|
$(Q) $(DIRUNLINK) $(TOPDIR)/drivers/platform
|
||||||
|
|||||||
Reference in New Issue
Block a user