From 89096d0fc730ddcab2dc7aceee4812305a5f687a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 30 Aug 2019 09:28:47 -0600 Subject: [PATCH] tools/Makefile.win: Port changes of commit 3ed844640d25b854457b6cc08f89d907072c0054 to Makefile.win. Untested because I don't have a Windows native build platform setup. There have been a log of changes to the build system lately do to directory re-organization so likely the native build is broken. Certainly tools/configure.bat should be replaces with tools/configure.c. --- tools/Makefile.win | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/Makefile.win b/tools/Makefile.win index a0575bc2a8..cb2d1fa9f4 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -76,6 +76,8 @@ 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)$(DELIM)common$(DELIM)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 # will be built if APPDIR is defined. APPDIR will be defined if a directory containing @@ -345,6 +347,27 @@ else $(Q) echo FAKELNK > $(TOPDIR)\drivers\platform .fakelnk endif +ifeq ($(COMMON_DIR),y) +# Link the boards\\\common dir to arch\\src\board +# Link the boards\\\\src dir to arch\\src\board\board + +$(ARCH_SRC)\board: .config + @echo "LN: $(ARCH_SRC)\board to $(BOARD_DIR)\common" +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + $(Q) /user:administrator mklink /d $(ARCH_SRC)\board $(BOARD_DIR)\common +else + $(Q) xcopy $(BOARD_DIR)\common $(ARCH_SRC)\board /c /q /s /e /y /i + $(Q) echo FAKELNK > $(ARCH_SRC)\board\.fakelnk +endif + @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 +ifeq ($(CONFIG_WINDOWS_MKLINK),y) + $(Q) /user:administrator mklink /d $(ARCH_SRC)\board\board $(BOARD_DIR)\$(CONFIG_ARCH_BOARD)\src +else + $(Q) xcopy $(BOARD_DIR)\$(CONFIG_ARCH_BOARD)\src $(ARCH_SRC)\board\board /c /q /s /e /y /i + $(Q) echo FAKELNK > $(ARCH_SRC)\board\board\.fakelnk +endif +else # Link the boards\\\\src dir to arch\\src\board $(ARCH_SRC)\board: .config @@ -355,6 +378,7 @@ else $(Q) xcopy $(BOARD_DIR)\$(CONFIG_ARCH_BOARD)\src $(ARCH_SRC)\board /c /q /s /e /y /i $(Q) echo FAKELNK > $(ARCH_SRC)\board\.fakelnk endif +endif # Link arch\\include\ to arch\\include\chip @@ -412,6 +436,7 @@ clean_context: $(call DELDIR, include\arch\board) $(call DELDIR, include\arch\chip) $(call DELDIR, include\arch) + $(call DELDIR, $(ARCH_SRC)\board\board) $(call DELDIR, $(ARCH_SRC)\board) $(call DELDIR, $(ARCH_SRC)\chip) $(call DELDIR, $(TOPDIR)\drivers\platform)