aboutsummaryrefslogtreecommitdiff
path: root/compiler/compile.sh
blob: 2fb5f1d03f843030d1d40c300a18d2fa8b888e43 (plain)
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
#!/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