include/config.h:5:22: error: configs/.h: No such fileordirectory
1
2
错误显示:在include/config.h中出现的configs/.h并不能找到,对比编译2410生成的config.h文件,可见是config.h文件生成错误。要解决问题首先我们要找到生成config.h文件的地方,在顶层Makefile文件中找了很久都没找到生成config.h文件的地方,然后就有点无从下手了,偶然想到既然config.h是生成的文件,那么其中的注释/* Automatically generated - do not edit */应该是通过echo命令输出到config.h文件的,搜索 Automatically generated - do not edit 就应该可以找到生成config.h的地方。 搜索Automatically generated - do not edit,找到scripts/Makefile.autoconf文件,发现config.h正是在它里面生成的:
...# include/config.h# Prior to Kconfig, it was generated by mkconfig. Now it is created here.
define filechk_config_h
(echo "/* Automatically generated - do not edit */"; \
for i in $$(echo $(CONFIG_SYS_EXTRA_OPTIONS) | sed 's/,/ /g'); do \
echo \#define CONFIG_$$i \
| sed '/=/ {s/=/ /;q; } ; { s/$$/ 1/; }'; \
done; \
echo \#define CONFIG_BOARDDIR board/$(if $(VENDOR),$(VENDOR)/)$(BOARD);\
echo \#include \<config_defaults.h\>; \
echo \#include \<config_uncmd_spl.h\>; \
echo \#include \<configs/$(CONFIG_SYS_CONFIG_NAME).h\>; \
echo \#include \<asm/config.h\>; \
echo \#include \<config_fallbacks.h\>;)
endef
...
Tips to add/remove boards
-------------------------
When adding a new board, the following steps are generally needed:
[1] Add a header file include/configs/<target>.h
[2] Make sure to define necessary CONFIG_SYS_* in Kconfig:
Define CONFIG_SYS_CPU="cpu"to compile arch/<arch>/cpu/<cpu>
Define CONFIG_SYS_SOC="soc"to compile arch/<arch>/cpu/<cpu>/<soc>
Define CONFIG_SYS_VENDOR="vendor"to compile board/<vendor>/common/*
and board/<vendor>/<board>/*
Define CONFIG_SYS_BOARD="board"to compile board/<board>/*
(or board/<vendor>/<board>/* if CONFIG_SYS_VENDOR is defined)
Define CONFIG_SYS_CONFIG_NAME="target"to include
include/configs/<target>.h
[3] Add a new entry tothe board select menu in Kconfig.
The board select menu is located in arch/<arch>/Kconfig or
arch/<arch>/*/Kconfig.
[4] Add a MAINTAINERS file
It is generally placed at board/<board>/MAINTAINERS or
board/<vendor>/<board>/MAINTAINERS
[5] Add configs/<target>_defconfig
When removing an obsolete board, the following steps are generally needed:
[1] Remove configs/<target>_defconfig
[2] Remove include/configs/<target>.h ifitisnot used by any other boards
[3] Remove board/<vendor>/<board>/* or board/<board>/* ifitisnot used
by any other boards
[4] Update MAINTAINERS if necessary
[5] Remove the unused entry fromthe board select menu in Kconfig
[6] Add an entry to doc/README.scrapyard