Ross Light avatar Ross Light committed c3929bd

Make build script more friendly

Comments (0)

Files changed (1)

 #!/bin/bash
 
+# BEGIN CONFIGURATION
 BINUTILS_VERSION=2.21
 GCC_VERSION=4.5.2
 MPFR_VERSION=3.0.1
 GMP_VERSION=5.0.2
 MPC_VERSION=0.8.2
-PATCHROOT="$HOME/src/FIRST/gcc-patches"
-PREFIX="$HOME/vxworks"
-SRC="$HOME/src/FIRST/gcc-src"
-BUILD="$HOME/src/FIRST/gcc-build"
 JOBS=4
-
-function download()
-{
-    [ -e "$SRC/$1" ] || wget -O "$SRC/$1" "$2"
-}
+# END CONFIGURATION
 
 function die()
 {
     exit 1
 }
 
+[ -e build.bash ] || die "Must cd into source directory"
+PATCHROOT="$(pwd)"
+
+[ $# -eq 3 ] || die "usage: build.bash PREFIX SRC BUILD"
+PREFIX="$1"
+SRC="$2"
+BUILD="$3"
+
+function download()
+{
+    [ -e "$SRC/$1" ] || wget -O "$SRC/$1" "$2"
+}
+
 export PATH="$PREFIX/bin:$PATH"
 export WIND_BASE="$PREFIX/powerpc-wrs-vxworks/wind_base"
 
     --with-cpu-PPC603 \
     CFLAGS="-g -O2" \
 
-# TODO: Document if necessary
 make -j "$JOBS" || die "** gcc build failed"
 make -j "$JOBS" install || die "** gcc install failed"
 
-
 echo "libstdc++:"
 cd "$BUILD/libstdc++"
 "$SRC/gcc-$GCC_VERSION/libstdc++-v3/configure" \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.