OPTS="-fs -u -v 9"

INC="defs global_vars pass1/scanner/scan_sep_inc pass1/applinfer/outermost_inc"


# list of files to compile - full path - but no suffix
SRC="globals_init \
tmain 
mine \
pass1/scanner/scan \
pass1/parser/grammar.fixed \
pass1/parser/initids \
pass1/applinfer/precedence \
pass1/stt/stt \
pass5d/RIC \
stree/ststructs_cls \
stree/mknode \
pass1/applinfer/mkappl \
stree/Array \
pass1/applinfer/mkappl2 \
pass1/applinfer/outermost_op \
pass1/applinfer/single_arg \
pass1/applinfer/cand_cond \
pass1/applinfer/cor_cond \
sigio/sig_out \
sigio/sig_in \
pass2/add_id \
pass2/process_id \
pass2/restore \
pass2/retrieve \
pass2/build_symtab"

# list of .u file - no path but .tmp.u suffix
US="globals_init.tmp.u \
tmain.tmp.u \
mine.tmp.u \
scan.tmp.u \
grammar.fixed.tmp.u \
initids.tmp.u \
precedence.tmp.u \
stt.tmp.u \
RIC.tmp.u \
ststructs_cls.tmp.u \
mknode.tmp.u \
mkappl.tmp.u \
Array.tmp.u \
mkappl2.tmp.u \
outermost_op.tmp.u \
single_arg.tmp.u \
cand_cond.tmp.u \
cor_cond.tmp.u \
sig_out.tmp.u \
sig_in.tmp.u \
add_id.tmp.u \
process_id.tmp.u \
restore.tmp.u \
retrieve.tmp.u \
build_symtab.tmp.u"

for var in $SRC
do
    ruby djdpre.rb <$var.icn >$var.tmp.icn
    if unicon -c $OPTS $var.tmp.icn
    then echo $var.tmp.icn succeded
    else
    echo $var.tmp.icn failed
    break
    fi	
done

unicon -o ./tmain $US
