9e60e044e93c826b7e221673b2a63bfb2f8705a8
[mes.git] / install.sh
1 #! /bin/sh
2
3 set -e
4
5 PREFIX=${PREFIX-usr}
6 MES_PREFIX=${MES_PREFIX-$PREFIX/share/mes}
7 MES_SEED=${MES_SEED-../mes-seed}
8 TINYCC_SEED=${TINYCC_SEED-../tinycc-seed}
9
10 mkdir -p $PREFIX/bin
11 cp src/mes $PREFIX/bin/mes
12
13 mkdir -p $PREFIX/lib
14 mkdir -p $MES_PREFIX/lib
15 cp $MES_SEED/crt1.M1 $MES_PREFIX/lib/crt1.M1
16 cp $MES_SEED/libc-mes.M1 $MES_PREFIX/lib/libc-mes.M1
17 cp $MES_SEED/libc+tcc-mes.M1 $MES_PREFIX/lib/libc+tcc-mes.M1
18
19 cp crt1.hex2 $MES_PREFIX/lib/crt1.hex2
20 cp libc-mes.hex2 $MES_PREFIX/lib/libc-mes.hex2
21 cp libc+tcc-mes.hex2 $MES_PREFIX/lib/libc+tcc-mes.hex2
22
23 cp scripts/mescc $PREFIX/bin/mescc
24 sed -e "s,@PREFIX@,$MES_PREFIX,g" \
25     scripts/mescc > $PREFIX/bin/mescc
26
27 mkdir -p $MES_PREFIX
28 tar -cf- doc guile include lib module scaffold stage0 | tar -xf- -C $MES_PREFIX