You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/12/04 15:07:17 UTC

(nuttx) 01/02: sh:Enhanced compilation system

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit e4b561d51b5fa042370b77603f6383eb19011313
Author: chenrun1 <ch...@xiaomi.com>
AuthorDate: Fri Nov 24 16:38:10 2023 +0800

    sh:Enhanced compilation system
    
    In this change, if board/include and board/script are not found, they will be looked for again in the upper level of common.
    
    Signed-off-by: chenrun1 <ch...@xiaomi.com>
---
 tools/Unix.mk      |  8 +++++++-
 tools/configure.sh |  8 ++++++--
 tools/refresh.sh   | 11 +++++++++--
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/tools/Unix.mk b/tools/Unix.mk
index 2e5ca2b2a5..d251d0b457 100644
--- a/tools/Unix.mk
+++ b/tools/Unix.mk
@@ -279,10 +279,16 @@ include/arch:
 	$(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include $@
 
 # Link the boards/<arch>/<chip>/<board>/include directory to include/arch/board
+# If the above path does not exist, then we try to link to common
+
+LINK_INCLUDE_DIR=$(BOARD_DIR)/include
+ifeq ($(wildcard $(LINK_INCLUDE_DIR)),)
+	LINK_INCLUDE_DIR = $(BOARD_COMMON_DIR)/include
+endif
 
 include/arch/board: | include/arch
 	@echo "LN: $@ to $(BOARD_DIR)/include"
-	$(Q) $(DIRLINK) $(BOARD_DIR)/include $@
+	$(Q) $(DIRLINK) $(LINK_INCLUDE_DIR) $@
 
 # 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/board
diff --git a/tools/configure.sh b/tools/configure.sh
index 7804c67a9a..b5aba45ec6 100755
--- a/tools/configure.sh
+++ b/tools/configure.sh
@@ -167,8 +167,12 @@ if [ ! -r ${src_makedefs} ]; then
       src_makedefs=${configpath}/../../scripts/Make.defs
 
       if [ ! -r ${src_makedefs} ]; then
-        echo "File Make.defs could not be found"
-        exit 4
+        src_makedefs=${configpath}/../../../common/scripts/Make.defs
+
+        if [ ! -r ${src_makedefs} ]; then
+          echo "File Make.defs could not be found"
+          exit 4
+        fi
       fi
     fi
   fi
diff --git a/tools/refresh.sh b/tools/refresh.sh
index 786c1bcd1d..98f479993f 100755
--- a/tools/refresh.sh
+++ b/tools/refresh.sh
@@ -170,6 +170,9 @@ for CONFIG in ${CONFIGS}; do
   DEFCONFIG=$CONFIGDIR/defconfig
   MAKEDEFS2=$CONFIGDIR/Make.defs
 
+  SCRIPTSDIR2=$BOARDDIR/../common/scripts
+  MAKEDEFS3=$SCRIPTSDIR2/Make.defs
+
   # Check the board configuration directory
 
   if [ ! -d $BOARDDIR ]; then
@@ -193,8 +196,12 @@ for CONFIG in ${CONFIGS}; do
     if [ -r $MAKEDEFS1 ]; then
       MAKEDEFS=$MAKEDEFS1
     else
-      echo "No readable Make.defs file at $MAKEDEFS1 or $MAKEDEFS2"
-      exit 1
+      if [ -r $MAKEDEFS3 ]; then
+        MAKEDEFS=$MAKEDEFS3
+      else
+        echo "No readable Make.defs file at $MAKEDEFS1 or $MAKEDEFS2 or $MAKEDEFS3"
+        exit 1
+      fi
     fi
   fi