Build system: Hook tools/initconfig into top-level Makefiles.

This commit is contained in:
Gregory Nutt 2017-06-02 13:06:09 -06:00
parent efbd035b56
commit 430060e92e
3 changed files with 31 additions and 10 deletions

View File

@ -282,30 +282,38 @@ tools/cnvwindeps$(HOSTEXEEXT):
# configured directories.
Make.defs:
$(Q) echo "No Make.defs file found, creating one"
echo "include $(TOPDIR)$(DELIM).config" > Make.defs
echo "include $(TOPDIR)$(DELIM)tools$(DELIM)Config.mk" >> Make.defs
tools/initialconfig$(HOSTEXEEXT):
$(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" initialconfig$(HOSTEXEEXT)
.config: tools/initialconfig$(HOSTEXEEXT)
$(Q) echo "No .config file found, creating one"
$(Q) tools/initialconfig$(HOSTEXEEXT)
# Link the arch/<arch-name>/include directory to include/arch
include/arch: Make.defs
include/arch: .config Make.defs
@echo "LN: include/arch to $(ARCH_DIR)/include"
$(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include include/arch
# Link the configs/<board-name>/include directory to include/arch/board
include/arch/board: include/arch Make.defs include/arch
include/arch/board: include/arch
@echo "LN: include/arch/board to $(BOARD_DIR)/include"
$(Q) $(DIRLINK) $(BOARD_DIR)/include include/arch/board
# Link the configs/<board-name>/src dir to arch/<arch-name>/src/board
$(ARCH_SRC)/board: Make.defs
$(ARCH_SRC)/board:
@echo "LN: $(ARCH_SRC)/board to $(BOARD_DIR)/src"
$(Q) $(DIRLINK) $(BOARD_DIR)/src $(ARCH_SRC)/board
# Link arch/<arch-name>/include/<chip-name> to arch/<arch-name>/include/chip
$(ARCH_SRC)/chip: Make.defs
$(ARCH_SRC)/chip:
ifneq ($(CONFIG_ARCH_CHIP),)
@echo "LN: $(ARCH_SRC)/chip to $(ARCH_SRC)/$(CONFIG_ARCH_CHIP)"
$(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_SRC)/$(CONFIG_ARCH_CHIP) $(ARCH_SRC)/chip
@ -313,7 +321,7 @@ endif
# Link arch/<arch-name>/src/<chip-name> to arch/<arch-name>/src/chip
include/arch/chip: include/arch Make.defs
include/arch/chip: include/arch
ifneq ($(CONFIG_ARCH_CHIP),)
@echo "LN: include/arch/chip to $(ARCH_INC)/$(CONFIG_ARCH_CHIP)"
$(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_INC)/$(CONFIG_ARCH_CHIP) include/arch/chip

View File

@ -277,12 +277,20 @@ tools\mkdeps$(HOSTEXEEXT):
# configured directories.
Make.defs:
$(Q) echo "No Make.defs file found, creating one"
echo "include $(TOPDIR)$(DELIM).config" > Make.defs
echo "include $(TOPDIR)$(DELIM)tools$(DELIM)Config.mk" >> Make.defs
tools\initialconfig$(HOSTEXEEXT):
$(Q) $(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" initialconfig$(HOSTEXEEXT)
.config: tools\initialconfig$(HOSTEXEEXT)
$(Q) echo "No .config file found, creating one"
$(Q) tools\initialconfig$(HOSTEXEEXT)
# Link the arch\<arch-name>\include directory to include\arch
include\arch: Make.defs
include\arch: .config Make.defs
@echo LN: include\arch to $(ARCH_DIR)\include
ifeq ($(CONFIG_WINDOWS_MKLINK),y)
$(Q) /user:administrator mklink /d include\arch $(TOPDIR)\$(ARCH_DIR)\include
@ -293,7 +301,7 @@ endif
# Link the configs\<board-name>\include directory to include\arch\board
include\arch\board: include\arch Make.defs include\arch
include\arch\board: include\arch
@echo LN: include\arch\board to $(BOARD_DIR)\include
ifeq ($(CONFIG_WINDOWS_MKLINK),y)
$(Q) /user:administrator mklink /d include\arch\board $(BOARD_DIR)\include
@ -304,7 +312,7 @@ endif
# Link the configs\<board-name>\src dir to arch\<arch-name>\src\board
$(ARCH_SRC)\board: Make.defs
$(ARCH_SRC)\board:
@echo LN: $(ARCH_SRC)\board to $(BOARD_DIR)\src
ifeq ($(CONFIG_WINDOWS_MKLINK),y)
$(Q) /user:administrator mklink /d $(ARCH_SRC)\board $(BOARD_DIR)\src
@ -315,7 +323,7 @@ endif
# Link arch\<arch-name>\include\<chip-name> to arch\<arch-name>\include\chip
$(ARCH_SRC)\chip: Make.defs
$(ARCH_SRC)\chip:
ifneq ($(CONFIG_ARCH_CHIP),)
@echo LN: $(ARCH_SRC)\chip to $(ARCH_SRC)\$(CONFIG_ARCH_CHIP)
ifeq ($(CONFIG_WINDOWS_MKLINK),y)
@ -328,7 +336,7 @@ endif
# Link arch\<arch-name>\src\<chip-name> to arch\<arch-name>\src\chip
include\arch\chip: include\arch Make.defs
include\arch\chip: include\arch
ifneq ($(CONFIG_ARCH_CHIP),)
@echo LN: include\arch\chip to $(ARCH_INC)\$(CONFIG_ARCH_CHIP)
ifeq ($(CONFIG_WINDOWS_MKLINK),y)

View File

@ -841,5 +841,10 @@ int main(int argc, char **argv)
*/
create_config();
/* TODO: Copy a Make.defs file from a configuration for the selected
* board that supports the selected MCU.
*/
return 0;
}