#!/bin/sh usage() { echo "usage: mcc [LDFLAGS] file.c" >&2 exit 1 } for i do case $i in -*) flags="$flags $i" ;; *) if ! test -z $file then usage fi file=$i ;; esac done if test -z $file then usage fi ../minic/minic < $file > /tmp/minic.ssa && ../lisc/lisc < /tmp/minic.ssa > /tmp/minic.s && cc $flags /tmp/minic.s if test $? -ne 0 then echo "error processing file $file" >&2 fi