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