goto commence
        m4cc -- synopsis
		m4cc [-I directory-or-indirect-file]... [-Dsymbol] ... file.c

        shell variables
                a       root part of file.c
		b       a string of flags to be passed to m4
		c       flags for the C compiler
		d       temporary -- the first part of a C flag
                e       the directory where mk_include lives
		f       file.o
		g       status returned by the C compiler

: commence

:       'Strip off m4+ include flags'
= b ""
while ."$1" = ".-I"
        = b "$b $1"
        shift
        = b "$b $1"
        shift
end

:       'Strip off C compiler preprocessor defines'
= c ""
while "$1"
	expr substr $1 1 2 | = d
	if "$d" != "-D" break
	= c "$c $1"
	shift
end

= e "/ksb/emulator"

expr substr $1 1 "(" length $1 - 1 ")" | = a
= f $ao

$e/bin/mk_include -l $* | $e/bin/m4+ $b -I /ksb/emulator/include -  > $$.c

/bin/cc -c -O $c $$.c
= g $r
mv $$.o $f
rm $$.c

exit $g
