Obsolete unused backup project such as OK6410
guowenxue
2019-07-29 72ce17741a61cce63a47b81ae20f66bafab3a80e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff -Nuar u-boot-2011.09/build.sh u-boot-2011.09-ok335x/build.sh
--- u-boot-2011.09/build.sh    1970-01-01 08:00:00.000000000 +0800
+++ u-boot-2011.09-ok335x/build.sh    2019-07-29 13:42:52.862123947 +0800
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+TFTP_PATH=/tftp
+IMGS_PATH=../images
+IMG_NAME="u-boot.img MLO"
+
+CROSSTOOL=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
+JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l`
+
+
+function do_clean()
+{
+    make CROSS_COMPILE=${CROSSTOOL} distclean
+    rm -f MLO tags
+}
+
+function do_modify()
+{
+    grep "export ARCH=arm" Makefile > /dev/null
+
+    if [ $? == 0  ] ; then
+        return ;
+    fi
+
+    echo "Modify Makefile for  ARCH and cross compiler"
+    sed -i "/ARCH CPU BOARD VENDOR SOC/a\export CROSS_COMPILE=${CROSSTOOL}" Makefile
+    sed -i '/ARCH CPU BOARD VENDOR SOC/a\export ARCH=arm' Makefile
+}
+
+function do_build()
+{
+    make ok335x_config
+
+    make -j${JOBS}
+
+    chmod a-x u-boot
+
+    chmod a+x ${IMG_NAME}
+}
+
+function do_install()
+{
+    if [ -d $TFTP_PATH ] ;then 
+        cp ${IMG_NAME} $TFTP_PATH
+    fi
+
+    if [ -d ${IMGS_PATH} ] ; then
+        cp ${IMG_NAME} $IMGS_PATH
+    fi
+}
+
+if [ "$1" == "clean" ] ; then 
+
+    do_clean
+    exit 0;
+fi
+
+do_modify
+
+set -e
+
+do_build
+
+do_install
+
+
diff -Nuar u-boot-2011.09/Makefile u-boot-2011.09-ok335x/Makefile
--- u-boot-2011.09/Makefile    2013-11-20 14:14:16.000000000 +0800
+++ u-boot-2011.09-ok335x/Makefile    2019-07-29 13:39:47.514120392 +0800
@@ -155,6 +155,8 @@
 # load ARCH, BOARD, and CPU configuration
 include $(obj)include/config.mk
 export    ARCH CPU BOARD VENDOR SOC
+export ARCH=arm
+export CROSS_COMPILE=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
 
 # set default to nothing for native builds
 ifeq ($(HOSTARCH),$(ARCH))