]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Added guess_cc.sh to make it smoother to select compiler
authormahi <devnull@localhost>
Tue, 6 Oct 2009 17:07:38 +0000 (19:07 +0200)
committermahi <devnull@localhost>
Tue, 6 Oct 2009 17:07:38 +0000 (19:07 +0200)
scripts/build_all.sh
scripts/build_arm.sh
scripts/build_ppc.sh [new file with mode: 0644]
scripts/guess_cc.sh [new file with mode: 0644]

index baee8bfabef6406f22be5080d35bf46599d44ab9..4785cd5009450807434f91365ce6695614019744 100755 (executable)
@@ -1,46 +1,12 @@
 #/bin/bash
-
-function quit {
-       echo
-       echo "### BUILD FAILED"
-       echo 
-       exit $1
-}
-
-
-oo="aa $CROSS_COMPILE aa";
-echo "oo = $oo";
-if [ "aa $CROSS_COMPILE aa" == "aa  aa" ]; then
-  os=`uname`
-  echo $os
-  if [ "$os"=="Darwin" ]; then
-    export CROSS_COMPILE=/opt/powerpc-eabi/bin/powerpc-eabi-
-  else
-    export CROSS_COMPILE=/cygdrive/c/devtools/gcc/4.1.2/powerpc-eabispe/bin/powerpc-eabispe-
-  fi
-fi;
-
-export BDIR=system/kernel/testsystem
-make BOARDDIR=mpc5554sim clean 
-make BOARDDIR=mpc5554sim all 
-if [ $? -ne 0 ]; then quit 1
-fi
-
-make BOARDDIR=mpc551xsim clean 
-make BOARDDIR=mpc551xsim all 
-if [ $? -ne 0 ]; then quit 1
-fi
-
-make BOARDDIR=mpc5516it clean 
-make BOARDDIR=mpc5516it all
-if [ $? -ne 0 ]; then quit 1
-fi
-
-export BDIR=system/kernel/testsystem,examples/blinker_node 
-make BOARDDIR=mpc5567qrtech clean 
-make BOARDDIR=mpc5567qrtech all 
-if [ $? -ne 0 ]; then quit 1
-fi
+# Usage:
+#
+# build_all
+#
+
+SCRIPT_DIR=`dirname $0`   
+. ${SCRIPT_DIR}/build_ppc.sh
+. ${SCRIPT_DIR}/build_arm.sh
 
 exit 0
        
index ce4cefe330b6c2a0c0ebcdb1baff057daf2966c5..e0033f98002af1aa4af369e866e9268ef8f2a5b9 100755 (executable)
@@ -7,21 +7,18 @@ function quit {
     exit $1
 }
 
-oo="aa $CROSS_COMPILE aa";
-echo "oo = $oo";
-if [ "aa $CROSS_COMPILE aa" == "aa  aa" ]; then
-  os=`uname`
-  echo $os
-  if [ "$os" == "Darwin" ]; then
-    export CROSS_COMPILE=/opt/arm-elf/bin/arm-elf-
-  else  
-    export CROSS_COMPILE=/cygdrive/c/devtools/CodeSourcery/Lite/bin/arm-none-eabi-
-  fi
-fi;
-
-#export BDIR=system/kernel/testsystem
+SCRIPT_DIR=`dirname $0`   
+ARCH=ARM
+source ${SCRIPT_DIR}/guess_cc.sh
+       
 export BDIR=examples/tiny
 make BOARDDIR=et_stm32_stamp clean
 make BOARDDIR=et_stm32_stamp all
 if [ $? -ne 0 ]; then quit 1
 fi
+
+export BDIR=system/kernel/testsystem
+make BOARDDIR=et_stm32_stamp clean
+make BOARDDIR=et_stm32_stamp all
+if [ $? -ne 0 ]; then quit 1
+fi
diff --git a/scripts/build_ppc.sh b/scripts/build_ppc.sh
new file mode 100644 (file)
index 0000000..f6ff3bd
--- /dev/null
@@ -0,0 +1,47 @@
+#/bin/bash
+# Usage:
+#
+# build_ppc
+#
+
+function quit {
+       echo
+       echo "### BUILD FAILED"
+       echo 
+       exit $1
+}
+
+SCRIPT_DIR=`dirname $0`   
+ARCH=PPC
+source ${SCRIPT_DIR}/guess_cc.sh
+         
+export BDIR=system/kernel/testsystem
+make BOARDDIR=mpc5554sim clean 
+make BOARDDIR=mpc5554sim all 
+if [ $? -ne 0 ]; then quit 1
+fi
+
+make BOARDDIR=mpc551xsim clean 
+make BOARDDIR=mpc551xsim all 
+if [ $? -ne 0 ]; then quit 1
+fi
+
+make BOARDDIR=mpc5516it clean 
+make BOARDDIR=mpc5516it all
+if [ $? -ne 0 ]; then quit 1
+fi
+
+export BDIR=system/kernel/testsystem,examples/blinker_node 
+make BOARDDIR=mpc5567qrtech clean 
+make BOARDDIR=mpc5567qrtech all 
+if [ $? -ne 0 ]; then quit 1
+fi
+       
+
+
+
+
+
+
+
+
diff --git a/scripts/guess_cc.sh b/scripts/guess_cc.sh
new file mode 100644 (file)
index 0000000..f706f89
--- /dev/null
@@ -0,0 +1,39 @@
+#/bin/bash\r
+\r
+UNAME=`uname`\r
+echo $UNAME\r
+echo $1\r
+\r
+if [ "$ARCH" == "PPC" ]; then\r
+       if test x${UNAME:0:7} = xMINGW32; then\r
+         COMPILER=/c/devtools/Codesourcery/freescale-4.3/bin/powerpc-eabi-\r
+       elif test x${UNAME:0:9} = xCYGWIN_NT; then\r
+         COMPILER=/cygdrive/c/devtools/Codesourcery/freescale-4.3/bin/powerpc-eabi- \r
+       elif test x${UNAME:0:5} = xDarwin; then\r
+         COMPILER=/opt/powerpc-eabi/bin/powerpc-eabi-\r
+       else\r
+         echo No default path for $UNAME set. Quitting.\r
+       fi \r
+elif [ "$ARCH" == "ARM" ]; then \r
+       if test x${UNAME:0:7} = xMINGW32; then\r
+         COMPILER=/c/devtools/Codesourcery/arm-2009q1/bin/arm-none-eabi-\r
+       elif test x${UNAME:0:9} = xCYGWIN_NT; then\r
+         COMPILER=/cygdrive/c/devtools/Codesourcery/arm-2009q1/bin/arm-none-eabi- \r
+       elif test x${UNAME:0:5} = xDarwin; then\r
+         COMPILER=/opt/arm-elf/bin/arm-none-eabi-  \r
+       else\r
+         echo No default path for $UNAME set. Quitting.\r
+       fi \r
+else \r
+       echo baaaad\r
+fi\r
+\r
+if [ -f ${COMPILER}gcc ]; then   \r
+  echo Using compiler: ${COMPILER}\r
+else \r
+   echo ${COMPILER} does not exist...\r
+   exit 1  \r
+fi     \r
+\r
+export CROSS_COMPILE=$COMPILER          \r
+\r