diff --git a/boards/arm/cxd56xx/common/Kconfig b/boards/arm/cxd56xx/common/Kconfig new file mode 100644 index 0000000000..f72f3c094c --- /dev/null +++ b/boards/arm/cxd56xx/common/Kconfig @@ -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. +# diff --git a/boards/arm/cxd56xx/common/Makefile b/boards/arm/cxd56xx/common/Makefile new file mode 100644 index 0000000000..0326d1849d --- /dev/null +++ b/boards/arm/cxd56xx/common/Makefile @@ -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 diff --git a/boards/arm/cxd56xx/common/src/Make.defs b/boards/arm/cxd56xx/common/src/Make.defs new file mode 100644 index 0000000000..a8da168209 --- /dev/null +++ b/boards/arm/cxd56xx/common/src/Make.defs @@ -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) diff --git a/boards/arm/cxd56xx/spresense/src/Makefile b/boards/arm/cxd56xx/spresense/src/Make.defs similarity index 93% rename from boards/arm/cxd56xx/spresense/src/Makefile rename to boards/arm/cxd56xx/spresense/src/Make.defs index efc768f743..2837927e3b 100644 --- a/boards/arm/cxd56xx/spresense/src/Makefile +++ b/boards/arm/cxd56xx/spresense/src/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/arm/cxd56x/spresense/src/Makefile +# boards/arm/cxd56x/spresense/src/Make.defs # # 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_boot.c CSRCS += cxd56_clock.c @@ -133,4 +126,6 @@ ifeq ($(CONFIG_LCD_ILI9340),y) CSRCS += cxd56_ili9340.c 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) diff --git a/tools/Makefile.unix b/tools/Makefile.unix index 43c8259de4..f5baa5ad8e 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -80,6 +80,7 @@ endif else BOARD_DIR = $(TOPDIR)$(DELIM)boards$(DELIM)$(CONFIG_ARCH)$(DELIM)$(CONFIG_ARCH_CHIP) 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. # 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" $(Q) $(DIRLINK) $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/include include/arch/board +ifeq ($(COMMON_DIR),y) +# Link the boards///common dir to arch//src/board # Link the boards////src dir to arch//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////src dir to arch//src/boar + $(ARCH_SRC)/board: .config @echo "LN: $(ARCH_SRC)/board to $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src" $(Q) $(DIRLINK) $(BOARD_DIR)/$(CONFIG_ARCH_BOARD)/src $(ARCH_SRC)/board +endif # Link the boards///drivers dir to drivers/platform @@ -380,6 +392,7 @@ clean_context: $(Q) $(DIRUNLINK) include/arch/board $(Q) $(DIRUNLINK) include/arch/chip $(Q) $(DIRUNLINK) include/arch + $(Q) $(DIRUNLINK) $(ARCH_SRC)/board/board $(Q) $(DIRUNLINK) $(ARCH_SRC)/board $(Q) $(DIRUNLINK) $(ARCH_SRC)/chip $(Q) $(DIRUNLINK) $(TOPDIR)/drivers/platform