summaryrefslogtreecommitdiffstats
path: root/tools/build.sh
blob: cfc5fec56c190a80757ec498576cf6d47325ce01 (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
#!/bin/sh -xe
here="$(pwd)"
if [ -f /proc/cpuinfo ]; then
    cpus=$(grep '^processor' /proc/cpuinfo | wc -l)
else
    cpus=2
fi
# 2 jobs per CPU
cpus=$((cpus*2))

PATH="$here"/bin:"$PATH"
export PATH

rm -rf build bin lib lib64 libexec share m68k-none-elf
mkdir build

cd build
mkdir binutils gcc

cd binutils
../../src/binutils/configure --prefix="$here" --target=m68k-none-elf \
    --disable-libssp --disable-werror
make -j$cpus
make install

cd ../gcc
../../src/gcc/configure --prefix="$here" --target=m68k-none-elf \
    --disable-libssp --disable-werror --enable-languages=c
make -j$cpus
make install