#
#  This makefile correctly builds TECOC on a Sun running the SunOS operating
#  system version 4.0,  which is based on 4.3BSD (Berkeley) Unix.
#

LIBRARY = tecoc.a

CC=    gcc -Wall -Wshadow -Wid-clash-6 -Wpointer-arith -Wcast-qual -DSUNOS4_0
#CC=	cc -m68020 -DSUNOS4_0
CPP=	/lib/cpp

# CFLAGS= -g
CFLAGS= -O
CPPFLAGS=
LDFLAGS=

CFILES=	baksrc.c bldstr.c clenup.c cmatch.c docjr.c doeves.c doflag.c \
	echoit.c err.c exea.c exeats.c exeb.c exebar.c exebsl.c exec.c \
	execcc.c execln.c execom.c execrt.c execst.c execta.c exectc.c \
	exectd.c execte.c execti.c exectl.c exectn.c execto.c exectp.c \
	exectq.c exectr.c exects.c exectt.c exectu.c exectv.c exectw.c \
	exectx.c execty.c exectz.c exed.c exedgt.c exedot.c exedqu.c \
	exee.c exeequ.c exeesc.c exeexc.c exeey.c exef.c exefb.c exeg.c \
	exegtr.c exeh.c exei.c exeill.c exej.c exek.c exel.c exelbr.c \
	exelst.c exem.c exen.c exenul.c exenyi.c exeo.c exeopr.c exep.c \
	exeprc.c exepw.c exeq.c exeqes.c exer.c exerbr.c exertp.c exes.c \
	exescl.c exet.c exeu.c exeund.c exeusc.c exev.c exew.c exex.c \
	exey.c exez.c findes.c findqr.c flowec.c flowee.c flowel.c \
	getara.c getnma.c inccbp.c init.c insstr.c isradx.c ln2chr.c \
	makdbf.c makrom.c popmac.c pshmac.c pushex.c rdline.c rdpage.c \
	readcs.c replac.c search.c singlp.c skpcmd.c srclop.c sserch.c \
	tabort.c typbuf.c typest.c uminus.c wrpage.c zfrsrc.c zunix.c

OBJECTS= $(CFILES:.c=.o)

.PRECIOUS: ${LIBRARY}

tecoc: tecoc.o ${LIBRARY}(${OBJECTS})
	ranlib ${LIBRARY}
	${LINK.c} -o $@ tecoc.o ${LIBRARY} -ltermcap

tecoc.o: tecoc.c zport.h tecoc.h deferr.h dchars.h chmacs.h

clean:
	@for i in makedep? ${OBJECTS} ; do \
		if [ -f $$i ] ; then rm $$i ; fi ; \
	done
	rm -f tecoc tecoc.o tecoc.a core

tags:
	etags *.c *.h

lint:
# a = report assigns of long to non-long variables
# b = report unreachable break statements
# c = complain about casts with questionable portability
# h = apply heuristic tests
# x = report unused externs
	lint -abchx -DSUNOS4_0 tecoc.c ${CFILES}


#
#  Invoking this target (with "make depend") causes a new version of this
#  file to be created.  This current version will be saved in a file named
#  "makefile.bak".  In the new file, the lines following the special "DO NOT
#  DELETE" line will be replaced with a new set of dependency rules.
#

depend: makedep
	@echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >makedep0
	@echo '$$r makedep5' >>makedep0
	@echo 'w' >>makedep0
	@cp makefile makefile.bak
	@ed - makefile < makedep0
	@rm makedep?
	@echo "new version of makefile generated, old version in makefile.bak"

makedep: FRC
	@cat /dev/null >makedep5
	@echo "generating include file dependency list..."
	@-(for i in ${CFILES} ; do \
		${CPP} -M $$i >> makedep1; done) 2>makedepe
	@echo "generating new version of makefile..."
	@sed -e 's|: ./|: |' makedep1 > makedep2
	@awk ' { if ($$1 != prev)                              \
			{ print rec; rec = $$0; prev = $$1; }  \
		   else                                        \
			{ if (length(rec $$2) > 70)            \
				{ print rec; rec = $$0; }      \
			  else                                 \
				rec = rec " " $$2              \
			}                                      \
	       }                                               \
	       END { print rec }                               \
	     '                                                 \
	     makedep2 >makedep3
	@awk '/:/ {printf "${LIBRARY}(%s\n", $$0}' \
	     makedep3 >makedep4
	@sed -e 's|:|):|' makedep4 > makedep5
	@cat makedepe
	@(if [ -s makedepe ]; then false; fi)
FRC:


# DO NOT DELETE THIS LINE -- make depend uses it
tecoc.a(baksrc.o): baksrc.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
tecoc.a(bldstr.o): bldstr.c zport.h tecoc.h defext.h deferr.h dchars.h chmacs.h
tecoc.a(clenup.o): clenup.c zport.h tecoc.h defext.h
tecoc.a(cmatch.o): cmatch.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
tecoc.a(docjr.o): docjr.c zport.h tecoc.h defext.h deferr.h
tecoc.a(doeves.o): doeves.c zport.h tecoc.h defext.h dchars.h
tecoc.a(doflag.o): doflag.c zport.h tecoc.h defext.h
tecoc.a(echoit.o): echoit.c zport.h tecoc.h defext.h dchars.h
tecoc.a(err.o): err.c zport.h tecoc.h defext.h deferr.h dchars.h
tecoc.a(exea.o): exea.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeats.o): exeats.c zport.h tecoc.h defext.h
tecoc.a(exeb.o): exeb.c zport.h tecoc.h defext.h
tecoc.a(exebar.o): exebar.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exebsl.o): exebsl.c zport.h tecoc.h defext.h chmacs.h
tecoc.a(exec.o): exec.c zport.h tecoc.h defext.h
tecoc.a(execcc.o): execcc.c zport.h tecoc.h defext.h deferr.h
tecoc.a(execln.o): execln.c zport.h tecoc.h defext.h
tecoc.a(execom.o): execom.c zport.h tecoc.h defext.h deferr.h
tecoc.a(execrt.o): execrt.c zport.h tecoc.h defext.h chmacs.h deferr.h
tecoc.a(execst.o): execst.c zport.h tecoc.h defext.h deferr.h
tecoc.a(execta.o): execta.c zport.h tecoc.h defext.h dchars.h
tecoc.a(exectc.o): exectc.c zport.h tecoc.h defext.h dchars.h
tecoc.a(exectd.o): exectd.c zport.h tecoc.h defext.h
tecoc.a(execte.o): execte.c zport.h tecoc.h defext.h
tecoc.a(execti.o): execti.c zport.h tecoc.h defext.h dchars.h
tecoc.a(exectl.o): exectl.c zport.h tecoc.h defext.h dchars.h
tecoc.a(exectn.o): exectn.c zport.h tecoc.h defext.h
tecoc.a(execto.o): execto.c zport.h tecoc.h defext.h
tecoc.a(exectp.o): exectp.c zport.h tecoc.h defext.h
tecoc.a(exectq.o): exectq.c zport.h tecoc.h defext.h
tecoc.a(exectr.o): exectr.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exects.o): exects.c zport.h tecoc.h defext.h
tecoc.a(exectt.o): exectt.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exectu.o): exectu.c zport.h tecoc.h defext.h deferr.h dchars.h
tecoc.a(exectv.o): exectv.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exectw.o): exectw.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exectx.o): exectx.c zport.h tecoc.h defext.h
tecoc.a(execty.o): execty.c zport.h tecoc.h defext.h
tecoc.a(exectz.o): exectz.c zport.h tecoc.h defext.h
tecoc.a(exed.o): exed.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exedgt.o): exedgt.c zport.h tecoc.h defext.h deferr.h chmacs.h
tecoc.a(exedot.o): exedot.c zport.h tecoc.h defext.h
tecoc.a(exedqu.o): exedqu.c zport.h tecoc.h defext.h deferr.h chmacs.h
tecoc.a(exee.o): exee.c zport.h tecoc.h defext.h chmacs.h dchars.h deferr.h
tecoc.a(exeequ.o): exeequ.c zport.h tecoc.h defext.h dchars.h deferr.h
tecoc.a(exeesc.o): exeesc.c zport.h tecoc.h defext.h dchars.h
tecoc.a(exeexc.o): exeexc.c zport.h tecoc.h defext.h
tecoc.a(exeey.o): exeey.c zport.h tecoc.h defext.h
tecoc.a(exef.o): exef.c zport.h tecoc.h defext.h chmacs.h deferr.h
tecoc.a(exefb.o): exefb.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeg.o): exeg.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exegtr.o): exegtr.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeh.o): exeh.c zport.h tecoc.h defext.h
tecoc.a(exei.o): exei.c zport.h tecoc.h defext.h dchars.h deferr.h
tecoc.a(exeill.o): exeill.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exej.o): exej.c zport.h tecoc.h defext.h
tecoc.a(exek.o): exek.c zport.h tecoc.h defext.h
tecoc.a(exel.o): exel.c zport.h tecoc.h defext.h
tecoc.a(exelbr.o): exelbr.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exelst.o): exelst.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exem.o): exem.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exen.o): exen.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exenul.o): exenul.c zport.h tecoc.h defext.h
tecoc.a(exenyi.o): exenyi.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeo.o): exeo.c zport.h tecoc.h defext.h dchars.h deferr.h
tecoc.a(exeopr.o): exeopr.c zport.h tecoc.h defext.h
tecoc.a(exep.o): exep.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeprc.o): exeprc.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exepw.o): exepw.c zport.h tecoc.h defext.h
tecoc.a(exeq.o): exeq.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeqes.o): exeqes.c zport.h tecoc.h defext.h
tecoc.a(exer.o): exer.c zport.h tecoc.h defext.h
tecoc.a(exerbr.o): exerbr.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exertp.o): exertp.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exes.o): exes.c zport.h tecoc.h defext.h dchars.h deferr.h
tecoc.a(exescl.o): exescl.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exet.o): exet.c zport.h tecoc.h defext.h dchars.h
tecoc.a(exeu.o): exeu.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeund.o): exeund.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exeusc.o): exeusc.c zport.h tecoc.h defext.h dchars.h
tecoc.a(exev.o): exev.c zport.h tecoc.h defext.h
tecoc.a(exew.o): exew.c zport.h tecoc.h defext.h dscren.h
tecoc.a(exex.o): exex.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exey.o): exey.c zport.h tecoc.h defext.h deferr.h
tecoc.a(exez.o): exez.c zport.h tecoc.h defext.h
tecoc.a(findes.o): findes.c zport.h tecoc.h defext.h deferr.h
tecoc.a(findqr.o): findqr.c zport.h tecoc.h defext.h deferr.h chmacs.h
tecoc.a(flowec.o): flowec.c zport.h tecoc.h defext.h deferr.h
tecoc.a(flowee.o): flowee.c zport.h tecoc.h defext.h deferr.h
tecoc.a(flowel.o): flowel.c zport.h tecoc.h defext.h deferr.h
tecoc.a(getara.o): getara.c zport.h tecoc.h defext.h deferr.h
tecoc.a(getnma.o): getnma.c zport.h tecoc.h defext.h deferr.h
tecoc.a(inccbp.o): inccbp.c zport.h tecoc.h defext.h deferr.h
tecoc.a(init.o): init.c zport.h tecoc.h defext.h deferr.h
tecoc.a(insstr.o): insstr.c zport.h tecoc.h defext.h deferr.h
tecoc.a(isradx.o): isradx.c zport.h tecoc.h defext.h chmacs.h
tecoc.a(ln2chr.o): ln2chr.c zport.h tecoc.h defext.h dchars.h chmacs.h
tecoc.a(makdbf.o): makdbf.c zport.h tecoc.h defext.h
tecoc.a(makrom.o): makrom.c zport.h tecoc.h defext.h deferr.h
tecoc.a(popmac.o): popmac.c zport.h tecoc.h defext.h
tecoc.a(pshmac.o): pshmac.c zport.h tecoc.h defext.h deferr.h
tecoc.a(pushex.o): pushex.c zport.h tecoc.h defext.h dchars.h deferr.h
tecoc.a(rdline.o): rdline.c zport.h tecoc.h defext.h deferr.h dchars.h
tecoc.a(rdpage.o): rdpage.c zport.h tecoc.h defext.h deferr.h
tecoc.a(readcs.o): readcs.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
tecoc.a(readcs.o): dscren.h
tecoc.a(replac.o): replac.c zport.h tecoc.h defext.h dchars.h
tecoc.a(search.o): search.c zport.h tecoc.h defext.h deferr.h dchars.h
tecoc.a(singlp.o): singlp.c zport.h tecoc.h defext.h dchars.h
tecoc.a(skpcmd.o): skpcmd.c zport.h tecoc.h defext.h chmacs.h dchars.h deferr.h
tecoc.a(srclop.o): srclop.c zport.h tecoc.h defext.h deferr.h
tecoc.a(sserch.o): sserch.c zport.h tecoc.h defext.h
tecoc.a(tabort.o): tabort.c zport.h tecoc.h
tecoc.a(typbuf.o): typbuf.c zport.h tecoc.h defext.h dchars.h chmacs.h
tecoc.a(typest.o): typest.c zport.h tecoc.h defext.h dchars.h
tecoc.a(uminus.o): uminus.c zport.h tecoc.h defext.h
tecoc.a(wrpage.o): wrpage.c zport.h tecoc.h defext.h dchars.h deferr.h
tecoc.a(zfrsrc.o): zfrsrc.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
tecoc.a(zunix.o): zunix.c zport.h tecoc.h clpars.h dchars.h
tecoc.a(zunix.o): deferr.h defext.h dscren.h vrbmsg.h
