diff --git a/tools/Unix.mk b/tools/Unix.mk index d251d0b457..bd8384c03a 100644 --- a/tools/Unix.mk +++ b/tools/Unix.mk @@ -283,7 +283,9 @@ include/arch: LINK_INCLUDE_DIR=$(BOARD_DIR)/include ifeq ($(wildcard $(LINK_INCLUDE_DIR)),) - LINK_INCLUDE_DIR = $(BOARD_COMMON_DIR)/include + ifneq ($(strip $(BOARD_COMMON_DIR)),) + LINK_INCLUDE_DIR = $(BOARD_COMMON_DIR)/include + endif endif include/arch/board: | include/arch diff --git a/tools/Win.mk b/tools/Win.mk index af8b21c7ad..bf14b01caf 100644 --- a/tools/Win.mk +++ b/tools/Win.mk @@ -264,10 +264,18 @@ include\arch: $(Q) $(DIRLINK) $(TOPDIR)\$(ARCH_DIR)\include $@ # Link the boards\\\\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)),) + ifneq ($(strip $(BOARD_COMMON_DIR)),) + LINK_INCLUDE_DIR = $(BOARD_COMMON_DIR)/include + endif +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\\\common dir to arch\\src\board # Link the boards\\\\src dir to arch\\src\board\board diff --git a/tools/configure.c b/tools/configure.c index f18bbae213..b4de9ed37f 100644 --- a/tools/configure.c +++ b/tools/configure.c @@ -1121,13 +1121,19 @@ static void check_configuration(void) debug("check_configuration: Checking %s\n", g_buffer); if (!verify_file(g_buffer)) { - fprintf(stderr, "ERROR: No Make.defs file in %s\n", - g_configpath); - fprintf(stderr, " No Make.defs file in %s\n", - g_scriptspath); - fprintf(stderr, "Run tools/configure -L" - " to list available configurations.\n"); - exit(EXIT_FAILURE); + /* Let’s check if there is a script in the common directory */ + + snprintf(g_buffer, BUFFER_SIZE, + "%s%c..%c..%c..%ccommon%cscripts%cMake.defs", + g_configpath, g_delim, g_delim, g_delim, g_delim, + g_delim, g_delim); + if (!verify_file(g_buffer)) + { + fprintf(stderr, "ERROR: No Make.defs file found\n"); + fprintf(stderr, "Run tools/configure -L" + " to list available configurations.\n"); + exit(EXIT_FAILURE); + } } } else