build: add prom's setting
[kernel/u-boot.git] / build.sh
1 #!/bin/sh
2
3 # Set default cross compiler
4 CROSS_COMPILER=/opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-
5
6 # Check this system has ccache
7 check_ccache()
8 {
9         type ccache
10         if [ "$?" -eq "0" ]; then
11                 CCACHE=ccache
12         fi
13 }
14
15 check_users()
16 {
17         USER=`whoami`
18         if [ "$USER" = "kmpark" ]; then
19                 CROSS_COMPILER=/pub/toolchains/gcc-4.3.2/bin/arm-none-linux-gnueabi-
20                 JOBS="-j 4"
21         fi
22         if [ "$USER" = "dofmind" ]; then
23                 CROSS_COMPILER=/opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-
24                 JOBS="-j 5"
25         fi
26         if [ "$USER" = "prom" ]; then
27                 CROSS_COMPILER=/opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-
28                 JOBS="-j 5"
29         fi
30 }
31
32 build_uboot()
33 {
34         make ARCH=arm CROSS_COMPILE="$CCACHE $CROSS_COMPILER" $JOBS $*
35 }
36
37 check_ccache
38 check_users
39
40 build_uboot $*
41
42 if [ "$USER" = "kmpark" ]; then
43         cp -f u-boot.bin u-boot-onenand.bin /tftpboot
44         ls -al u-boot.bin u-boot-onenand.bin
45         ls -al onenand_ipl
46         pushd ../images
47         ./system.sh
48         popd
49 elif [ "$USER" = "dofmind" ]; then
50         tar cvf system_uboot.tar u-boot-onenand.bin
51         mv -f system_uboot.tar /home/work
52 elif [ "$USER" = "prom" ]; then
53         tar cvf system_uboot.tar u-boot-onenand.bin
54 fi