添加了牛皮藓,主要方便不知情的人联系我。有洁癖者自己去除代码,在
[ddnasgpl.git] / mkconfig
blob54775d31dfef42fe0295640054976f691c1e48b3
1 #!/bin/sh -e
3 # Script to create header files and links to configure
4 # U-Boot for a specific board.
6 # Parameters: Target Architecture CPU Board [VENDOR] [SOC]
8 # (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
11 APPEND=no # Default: Create new config file
13 while [ $# -gt 0 ] ; do
14 case "$1" in
15 --) shift ; break ;;
16 -a) shift ; APPEND=yes ;;
17 *) break ;;
18 esac
19 done
21 [ $# -lt 4 ] && exit 1
22 [ $# -gt 6 ] && exit 1
24 echo "Configuring for $1 board..."
26 cd ./include
29 # Create link to architecture specific headers
31 rm -f asm
32 ln -s asm-$2 asm
33 rm -f asm-$2/arch
35 if [ -z "$6" -o "$6" = "NULL" ] ; then
36 ln -s arch-$3 asm-$2/arch
37 else
38 ln -s arch-$6 asm-$2/arch
41 if [ "$2" = "arm" ] ; then
42 rm -f asm-$2/proc
43 ln -s proc-armv asm-$2/proc
47 # Create include file for Make
49 echo "ARCH = $2" > config.mk
50 echo "CPU = $3" >> config.mk
51 echo "BOARD = $4" >> config.mk
53 [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
55 [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
58 # Create board specific header file
60 if [ "$APPEND" = "yes" ] # Append to existing config file
61 then
62 echo >> config.h
63 else
64 > config.h # Create new config file
66 echo "/* Automatically generated - do not edit */" >>config.h
67 echo "#include <configs/$1.h>" >>config.h
69 exit 0