-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmk_js_to_c_c_min
executable file
·40 lines (28 loc) · 1.51 KB
/
mk_js_to_c_c_min
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
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/M2libc/x86/linux/bootstrap.c /tmp/tcc_js_tmp/
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/M2libc/bootstrappable.c /tmp/tcc_js_tmp/
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/M2libc/x86/libc-core.M1 /tmp/tcc_js_tmp/
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/x86/ELF-i386.hex2 /tmp/tcc_js_tmp/
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/x86/x86_defs.M1 /tmp/tcc_js_tmp/
cd tcc_js
rm /tmp/tcc_js_tmp/js_to_c*exe
cp bootstrappable_load.c /tmp/tcc_js_tmp/
cp bootstrap_load.c /tmp/tcc_js_tmp/
cp dummy_tcc.js /tmp/tcc_js_tmp/tcc.js
cp dummy_include.js /tmp/tcc_js_tmp/
cat elf_loader_support.c elf_loader_support_cc_x86.c js_to_c.c > /tmp/tcc_js_tmp/js_to_c_all.c
cd ..
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/M2libc/x86/libc-core.M1 /tmp/tcc_js_tmp/
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/x86/ELF-i386.hex2 /tmp/tcc_js_tmp/
cp ../mishmashvm/tcc_js_bootstrap/alt_bootstrap/stage0-posix/x86/x86_defs.M1 /tmp/tcc_js_tmp/
pushd .
cd /tmp/tcc_js_tmp/
rm out_cc_x86-0.M1 out_cc_x86-0.hex2 out_cc_x86-0-0.hex2
set -e
cat bootstrap_load.c bootstrappable_load.c js_to_c_all.c > out.c
echo "cc_x86 compile"
./cc_x86 out.c out_cc_x86.M1
echo "cc_x86 assemble and link"
cat x86_defs.M1 libc-core.M1 out_cc_x86.M1 > out_cc_x86-0.M1
./M0 out_cc_x86-0.M1 out_cc_x86-0.hex2
cat ELF-i386.hex2 out_cc_x86-0.hex2 > out_cc_x86-0-0.hex2
./hex2-0 out_cc_x86-0-0.hex2 js_to_c_cc_x86.exe