Subversion Repositories HelenOS-historic

Rev

Rev 534 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 534 Rev 545
1
#! /bin/sh
1
#! /bin/sh
2
 
2
 
3
function syntax {
3
function syntax {
4
	echo "Syntax:"
4
	echo "Syntax:"
5
	echo " build.<arch> [-compiler <compiler>] [-cpu <cpu>] [-machine <machine>]"
5
	echo " build.<arch> [-compiler <compiler>] [-cpu <cpu>] [-machine <machine>]"
6
	echo
6
	echo
7
	echo "<arch>     ... amd64, ia32, ia64, mips32, ppc32, sparc64"
7
	echo "<arch>     ... amd64, ia32, ia64, mips32, ppc32, sparc64"
8
	echo "<compiler> ... native, *cross"
8
	echo "<compiler> ... native, *cross"
9
	echo "<cpu>      ... for ia32: athlon-xp, athlon-mp, pentium3, *pentium4, prescott"
9
	echo "<cpu>      ... for ia32: athlon-xp, athlon-mp, pentium3, *pentium4, prescott"
10
	echo "<machine>  ... for mips32: *msim, msim4kc, simics, lgxemul, bgxemul, indy"
10
	echo "<machine>  ... for mips32: *msim, msim4kc, simics, lgxemul, bgxemul, indy"
11
	echo
11
	echo
12
}
12
}
13
 
13
 
14
ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
14
ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
15
if [ -z "$ARCH" ]; then
15
if [ -z "$ARCH" ]; then
16
	syntax
16
	syntax
17
	exit 1
17
	exit 1
18
fi
18
fi
19
 
19
 
20
ARGS=""
20
ARGS=""
21
while [ "$#" -gt 0 ]; do
21
while [ "$#" -gt 0 ]; do
22
	case "$1" in
22
	case "$1" in
23
		-compiler)
23
		-compiler)
24
			if [ -z "$2" ]; then
24
			if [ -z "$2" ]; then
25
				syntax
25
				syntax
26
				exit 1
26
				exit 1
27
			fi
27
			fi
28
			ARGS="$ARGS COMPILER=$2"
28
			ARGS="$ARGS COMPILER=$2"
29
			shift
29
			shift
30
			;;
30
			;;
31
		-cpu)
31
		-cpu)
32
			if [ -z "$2" ]; then
32
			if [ -z "$2" ]; then
33
				syntax
33
				syntax
34
				exit 1
34
				exit 1
35
			fi
35
			fi
36
			ARGS="$ARGS CPU=$2"
36
			ARGS="$ARGS CPU=$2"
37
			shift
37
			shift
38
			;;
38
			;;
39
		-machine)
39
		-machine)
40
			if [ -z "$2" ]; then
40
			if [ -z "$2" ]; then
41
				syntax
41
				syntax
42
				exit 1
42
				exit 1
43
			fi
43
			fi
44
			ARGS="$ARGS MACHINE=$2"
44
			ARGS="$ARGS MACHINE=$2"
45
			shift
45
			shift
46
			;;
46
			;;
47
		*)
47
		*)
48
			syntax
48
			syntax
49
			exit 1
49
			exit 1
50
			;;
50
			;;
51
	esac
51
	esac
52
	shift
52
	shift
53
done
53
done
54
 
54
 
55
TAG="`svnversion . 2> /dev/null`"
55
TAG="`svnversion . 2> /dev/null`"
56
TIMESTAMP="`date "+%Y-%m-%d %H:%M:%S" 2> /dev/null`"
56
TIMESTAMP="`date "+%Y-%m-%d %H:%M:%S" 2> /dev/null`"
57
if [ -z "$TAG" ] || [ "$TAG" == "exported" ]; then
57
if [ -z "$TAG" ] || [ "$TAG" == "exported" ]; then
58
	TAG="Built on $TIMESTAMP for $ARCH"
58
	TAG="Built on $TIMESTAMP for $ARCH"
59
else
59
else
60
	TAG="Revision $TAG (built on $TIMESTAMP for $ARCH)"
60
	TAG="Revision $TAG (built on $TIMESTAMP for $ARCH)"
61
fi
61
fi
62
 
62
 
-
 
63
tools/config.py default
63
make all "ARCH=$ARCH" "TAG=$TAG" $ARGS
64
make all "ARCH=$ARCH" "TAG=$TAG" $ARGS
64
 
65