]> git.ipfire.org Git - people/ms/u-boot.git/blame - mkconfig
Remove the board/netstar/crcit binary from git repository.
[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
5078cce8 12BOARD_NAME="" # Name to print in make output
7ebf7443
WD
13
14while [ $# -gt 0 ] ; do
15 case "$1" in
16 --) shift ; break ;;
17 -a) shift ; APPEND=yes ;;
5078cce8 18 -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
7ebf7443
WD
19 *) break ;;
20 esac
21done
22
5078cce8
WD
23[ "${BOARD_NAME}" ] || BOARD_NAME="$1"
24
7ebf7443 25[ $# -lt 4 ] && exit 1
1d9f4105 26[ $# -gt 6 ] && exit 1
7ebf7443 27
5078cce8 28echo "Configuring for ${BOARD_NAME} board..."
7ebf7443
WD
29
30cd ./include
31
32#
33# Create link to architecture specific headers
34#
35rm -f asm
36ln -s asm-$2 asm
37rm -f asm-$2/arch
86c98882 38
507d3b0c 39if [ -z "$6" -o "$6" = "NULL" ] ; then
86c98882
WD
40 ln -s arch-$3 asm-$2/arch
41else
42 ln -s arch-$6 asm-$2/arch
43fi
7ebf7443 44
b783edae
WD
45if [ "$2" = "arm" ] ; then
46 rm -f asm-$2/proc
47 ln -s proc-armv asm-$2/proc
48fi
49
7ebf7443
WD
50#
51# Create include file for Make
52#
1d9f4105
WD
53echo "ARCH = $2" > config.mk
54echo "CPU = $3" >> config.mk
55echo "BOARD = $4" >> config.mk
7ebf7443 56
1d9f4105
WD
57[ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
58
59[ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
7ebf7443
WD
60
61#
62# Create board specific header file
63#
64if [ "$APPEND" = "yes" ] # Append to existing config file
65then
66 echo >> config.h
67else
68 > config.h # Create new config file
69fi
70echo "/* Automatically generated - do not edit */" >>config.h
71echo "#include <configs/$1.h>" >>config.h
72
73exit 0