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