#        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
#
#       '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"
	d=`expr substr $1 1 2`
	if "$d" != "-D" break
	c="$c $1"
	shift
end

e="/u/ksos/ksos11"

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

doincl -l $* | m4 $b -I $e/include -  > $$.c

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

exit $g
