wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 1 | #!/bin/sh -e |
| 2 | |
| 3 | # Script to create header files and links to configure |
| 4 | # U-Boot for a specific board. |
| 5 | # |
wdenk | 1d9f410 | 2004-10-09 22:21:29 +0000 | [diff] [blame^] | 6 | # Parameters: Target Architecture CPU Board [VENDOR] [SOC] |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 7 | # |
| 8 | # (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de> |
| 9 | # |
| 10 | |
| 11 | APPEND=no # Default: Create new config file |
| 12 | |
| 13 | while [ $# -gt 0 ] ; do |
| 14 | case "$1" in |
| 15 | --) shift ; break ;; |
| 16 | -a) shift ; APPEND=yes ;; |
| 17 | *) break ;; |
| 18 | esac |
| 19 | done |
| 20 | |
| 21 | [ $# -lt 4 ] && exit 1 |
wdenk | 1d9f410 | 2004-10-09 22:21:29 +0000 | [diff] [blame^] | 22 | [ $# -gt 6 ] && exit 1 |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 23 | |
| 24 | echo "Configuring for $1 board..." |
| 25 | |
| 26 | cd ./include |
| 27 | |
| 28 | # |
| 29 | # Create link to architecture specific headers |
| 30 | # |
| 31 | rm -f asm |
| 32 | ln -s asm-$2 asm |
| 33 | rm -f asm-$2/arch |
| 34 | ln -s arch-$3 asm-$2/arch |
| 35 | |
wdenk | b783eda | 2003-06-25 22:26:29 +0000 | [diff] [blame] | 36 | if [ "$2" = "arm" ] ; then |
| 37 | rm -f asm-$2/proc |
| 38 | ln -s proc-armv asm-$2/proc |
| 39 | fi |
| 40 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 41 | # |
| 42 | # Create include file for Make |
| 43 | # |
wdenk | 1d9f410 | 2004-10-09 22:21:29 +0000 | [diff] [blame^] | 44 | echo "ARCH = $2" > config.mk |
| 45 | echo "CPU = $3" >> config.mk |
| 46 | echo "BOARD = $4" >> config.mk |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 47 | |
wdenk | 1d9f410 | 2004-10-09 22:21:29 +0000 | [diff] [blame^] | 48 | [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk |
| 49 | |
| 50 | [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 51 | |
| 52 | # |
| 53 | # Create board specific header file |
| 54 | # |
| 55 | if [ "$APPEND" = "yes" ] # Append to existing config file |
| 56 | then |
| 57 | echo >> config.h |
| 58 | else |
| 59 | > config.h # Create new config file |
| 60 | fi |
| 61 | echo "/* Automatically generated - do not edit */" >>config.h |
| 62 | echo "#include <configs/$1.h>" >>config.h |
| 63 | |
| 64 | exit 0 |