# build the interpreter for Linux
rm -f *.o
exu ec.ex int.ex
echo compiling front-end 
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main-.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main-0.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer init-.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer int.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer wildcard.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer error.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer machine.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer symtab.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer scanner.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer scanne_0.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer emit.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer emit_0.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer emit_1.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer file.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer parser.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer parser_0.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer parser_1.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer compress.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer backend.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main.c
gcc -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer pathopen.c

echo compiling backend - for FreeBSD add -DEBSD
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_execute.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_runtime.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_w.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_main.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_alloc.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_symtab.c
gcc -c -w -DELINUX -fsigned-char -O2 -finline-functions -ffast-math -fomit-frame-pointer be_inline.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_machine.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fomit-frame-pointer be_task.c
gcc -c -w -DELINUX -fsigned-char -O -Os -fno-inline-functions -ffast-math -fomit-frame-pointer be_rterror.c
gcc -c -w -DELINUX -fsigned-char -O -Os -fno-inline-functions -ffast-math -fomit-frame-pointer be_syncolor.c
gcc -c -w -DELINUX -fsigned-char -O2 -ffast-math -fno-defer-pop be_callc.c

echo linking - for FreeBSD remove -ldl
gcc int.o main-.o main-0.o init-.o wildcard.o error.o machine.o symtab.o scanner.o scanne_0.o emit.o emit_0.o emit_1.o file.o parser.o parser_0.o parser_1.o compress.o backend.o main.o pathopen.o be_callc.o be_execute.o be_runtime.o be_w.o be_main.o be_alloc.o be_rterror.o be_symtab.o be_inline.o be_machine.o be_task.o be_syncolor.o -lm -ldl -oexu
rm -f *.o
ls -l exu
