if [ "${ARCH}" -a "${ARCH}" != "$2" ]; then echo "Failed: \$ARCH=${ARCH}, should be '$2' for ${BOARD_NAME}" 1>&2 exit 1 fi ### 当ARCH变量已定义时(Makefile中),判断其值与参数与$2 ### 是否相等,如果不相等则报错退出。[命令的-a,即当它左右两 ### 边的表达式同时为真时返回真。
echo "Configuring for ${BOARD_NAME} board..."
# # Create link to architecture specific headers # if [ "$SRCTREE" != "$OBJTREE" ] ; then mkdir -p ${OBJTREE}/include mkdir -p ${OBJTREE}/include2 cd ${OBJTREE}/include2 rm -f asm ln -s ${SRCTREE}/include/asm-$2 asm LNPREFIX="../../include2/asm/" cd ../include rm -rf asm-$2 rm -f asm mkdir asm-$2 ln -s asm-$2 asm else cd ./include rm -f asm ln -s asm-$2 asm fi ### 提供了对于不在源码目录里构建目标文件的支持。 ### 主要意思也就是创建符号链接asm以指向平台的头文件目论 ### 进入include目录中,创建符号链接asm,本例中位指向 ### asm-arm
rm -f asm-$2/arch
### 先删除符号链接asm-arm/arch
if [ -z "$6" -o "$6" = "NULL" ] ; then ln -s ${LNPREFIX}arch-$3 asm-$2/arch else ln -s ${LNPREFIX}arch-$6 asm-$2/arch fi
### 本例中在asm-arm下创建符号链接arch指向include目录下的 ### arch-s3c24x0 if [ "$2" = "arm" ] ; then rm -f asm-$2/proc ln -s ${LNPREFIX}proc-armv asm-$2/proc fi ### arm平台下还要在目录arm-arm下创建创建符号链接以 ### 指向include/asm-arm/proc-armv # # Create include file for Make # echo "ARCH = $2" > config.mk echo "CPU = $3" >> config.mk echo "BOARD = $4" >> config.mk