bootstrap: Add bootstrap build scripts.
[mes.git] / build.sh
1 #! /bin/sh
2
3 set -ex
4
5 HEX2=${HEX2-hex2}
6 M1=${M1-M1}
7 MES_SEED=${MES_SEED-../mes-seed}
8
9 $M1 --LittleEndian --Architecture=1\
10     -f stage0/x86.M1\
11     -f $MES_SEED/crt1.M1\
12     > crt1.hex2
13 $M1 --LittleEndian --Architecture=1\
14     -f stage0/x86.M1\
15     -f $MES_SEED/libc-mes.M1\
16     > libc-mes.hex2
17 $M1 --LittleEndian --Architecture=1\
18     -f stage0/x86.M1\
19     -f $MES_SEED/mes.M1\
20     > mes.hex2
21 $HEX2 --LittleEndian --Architecture=1 --BaseAddress=0x1000000\
22       -f stage0/elf32-header.hex2\
23       -f crt1.hex2\
24       -f libc-mes.hex2\
25       -f mes.hex2\
26       -f stage0/elf32-footer-single-main.hex2\
27       > mes
28 chmod +x mes
29
30 #TODO: after building from seed, build from src/mes.c
31
32 $M1 --LittleEndian --Architecture=1 -f\
33     stage0/x86.M1\
34     -f $MES_SEED/libc-mes+tcc.M1\
35     > libc-mes+tcc.hex2