aboutsummaryrefslogtreecommitdiff
path: root/compiler/compile.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-08-30 21:37:53 +0200
committerKarel Kočí <cynerd@email.cz>2017-08-30 21:42:02 +0200
commit9cf92379d5fcf0076c25dae0935daab446c992cd (patch)
treedd09a2e996db1e5a8117f01bec76f1e93eaca6e1 /compiler/compile.sh
downloadqtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.gz
qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.bz2
qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.zip
Initial commit
Adding work done so far.
Diffstat (limited to 'compiler/compile.sh')
-rwxr-xr-xcompiler/compile.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/compiler/compile.sh b/compiler/compile.sh
new file mode 100755
index 0000000..2fb5f1d
--- /dev/null
+++ b/compiler/compile.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# This script compiles compilation tools for mips to be used with qtmips
+set -e
+
+INST_PREFIX="$(pwd)"
+
+INST_CT_PREFIX="$INST_PREFIX/ct-ng"
+mkdir -p "$INST_CT_PREFIX"
+
+# First update git submodule
+pushd "$(dirname "$0")" >/dev/null
+git submodule update crosstool-ng
+
+pushd crosstool-ng >/dev/null
+
+# Now compile it
+# TODO don't compile it in place?
+./bootstrap
+./configure --prefix="$INST_CT_PREFIX"
+make
+make install
+# TODO do cleanups?
+
+popd >/dev/null
+
+popd >/dev/null
+
+# Copy configuration
+cp "$(dirname "$0")/config" ct-ng/.config
+
+pushd ct-ng >/dev/null
+
+# And compile
+./bin/ct-ng oldconfig
+CT_PREFIX="$INST_PREFIX" ./bin/ct-ng build
+
+popd >/dev/null
+
+# Cleanup installed crosstool-ng
+rm -rf ct-ng