1#
2# This makefile builds TECOC on Linux
3# Before running it,  inspect the lines between here and the line containing
4# all #'s to select the way you want TECO-C built.
5
6# If you want to compile with built-in debugging support,  uncomment the
7# following line.  When debugging is compiled in,  the control-P command
8# can be used to turn on function tracing or get views of internal data
9# structures (see the DbgDsp function in tecoc.c). Compiling in this support
10# makes TECO-C larger and a little slower,  so you should only use this
11# when you're debugging TECO-C.
12
13#DEBG = -DDEBUGGING
14
15# If you're debugging TECO-C,  use this option to compile in a consistency
16# checking function called after each command executes.  The function checks
17# the sanity of TECO-C's internal variables.  This obviously slows things
18# down a little.
19
20#CCHEK = -DCONSISTENCY_CHECKING
21
22# If you want to use gcc,  uncomment the following lines,  which override the
23# COMPILE.c macro so it doesn't stick in the -target option, which gcc
24# doesn't understand.
25
26#CFLAGS= ${OSVERS} ${DEBG} ${CCHEK} -O -Wall -Wshadow -Wpointer-arith -Wcast-qual -DLINUX
27CFLAGS+= -DLINUX
28#TERMOBJS = -ltermcap
29COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
30LINK.c = $(CC) $(LDFLAGS)
31
32#############################################################################
33
34CFILES=	baksrc.c bldstr.c clenup.c cmatch.c docjr.c doeves.c doflag.c \
35	echoit.c err.c exea.c exeats.c exeb.c exebar.c exebsl.c exec.c \
36	execcc.c execln.c execom.c execrt.c execst.c execta.c exectc.c \
37	exectd.c execte.c execti.c exectl.c exectn.c execto.c exectp.c \
38	exectq.c exectr.c exects.c exectt.c exectu.c exectv.c exectw.c \
39	exectx.c execty.c exectz.c exed.c exedgt.c exedot.c exedqu.c \
40	exee.c exeequ.c exeesc.c exeexc.c exeey.c exef.c exefb.c exeg.c \
41	exegtr.c exeh.c exei.c exeill.c exej.c exek.c exel.c exelbr.c \
42	exelst.c exem.c exen.c exenul.c exenyi.c exeo.c exeopr.c exep.c \
43	exeprc.c exepw.c exeq.c exeqes.c exer.c exerbr.c exertp.c exes.c \
44	exescl.c exet.c exeu.c exeund.c exeusc.c exev.c exew.c exex.c \
45	exey.c exez.c findes.c findqr.c flowec.c flowee.c flowel.c \
46	getara.c getnma.c inccbp.c init.c insstr.c isradx.c ln2chr.c \
47	makdbf.c makrom.c popmac.c pshmac.c pushex.c rdline.c rdpage.c \
48	readcs.c replac.c search.c singlp.c skpcmd.c srclop.c sserch.c \
49	tabort.c typbuf.c typest.c uminus.c wrpage.c zfrsrc.c zlinux.c
50
51OBJECTS= $(CFILES:.c=.o)
52
53tecoc: tecoc.o ${OBJECTS}
54	${LINK.c} -s -o $@ tecoc.o ${OBJECTS} ${TERMOBJS}
55
56tecoc.o: tecoc.c zport.h tecoc.h deferr.h dchars.h chmacs.h
57
58clpars.h: genclp clpars.tec
59	./genclp
60
61genclp: genclp.o
62	${LINK.c} -o $@ genclp.o
63
64genclp.o: genclp.c
65
66clean:
67	@for i in makedep? ${OBJECTS} ; do \
68		if [ -f $$i ] ; then rm $$i ; fi ; \
69	done
70	rm -f tecoc tecoc.o core
71
72tags:
73	etags *.c *.h
74
75lint:
76# b = report unreachable break statements
77# c = complain about casts with questionable portability
78# h = apply heuristic tests
79# x = report unused externs
80	lint -bchx -DSUNOS4_0 tecoc.c ${CFILES}
81
82
83#
84#  Invoking this target (with "make depend") causes a new version of this
85#  file to be created.  This current version will be saved in a file named
86#  "makefile.bak".  In the new file, the lines following the special "DO NOT
87#  DELETE" line will be replaced with a new set of dependency rules.
88#
89
90depend: makedep
91	@echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >makedep0
92	@echo '$$r makedep5' >>makedep0
93	@echo 'w' >>makedep0
94	@cp makefile makefile.bak
95	@ed - makefile < makedep0
96	@rm makedep?
97	@echo "new version of makefile generated, old version in makefile.bak"
98
99makedep: FRC
100	@cat /dev/null >makedep5
101	@echo "generating include file dependency list..."
102	@-(for i in ${CFILES} ; do \
103		${CPP} -M $$i >> makedep1; done) 2>makedepe
104	@echo "generating new version of makefile..."
105	@sed -e 's|: ./|: |' makedep1 > makedep2
106	@awk ' { if ($$1 != prev)                              \
107			{ print rec; rec = $$0; prev = $$1; }  \
108		   else                                        \
109			{ if (length(rec $$2) > 70)            \
110				{ print rec; rec = $$0; }      \
111			  else                                 \
112				rec = rec " " $$2              \
113			}                                      \
114	       }                                               \
115	       END { print rec }                               \
116	     '                                                 \
117	     makedep2 >makedep3
118	@awk '/:/ {printf "%s\n", $$0}' \
119	     makedep3 >makedep4
120	@sed -e 's|:|:|' makedep4 > makedep5
121	@cat makedepe
122	@(if [ -s makedepe ]; then false; fi)
123FRC:
124
125
126# DO NOT DELETE THIS LINE -- make depend uses it
127baksrc.o: baksrc.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
128bldstr.o: bldstr.c zport.h tecoc.h defext.h deferr.h dchars.h chmacs.h
129clenup.o: clenup.c zport.h tecoc.h defext.h
130cmatch.o: cmatch.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
131docjr.o: docjr.c zport.h tecoc.h defext.h deferr.h
132doeves.o: doeves.c zport.h tecoc.h defext.h dchars.h
133doflag.o: doflag.c zport.h tecoc.h defext.h
134echoit.o: echoit.c zport.h tecoc.h defext.h dchars.h
135err.o: err.c zport.h tecoc.h defext.h deferr.h dchars.h
136exea.o: exea.c zport.h tecoc.h defext.h deferr.h
137exeats.o: exeats.c zport.h tecoc.h defext.h
138exeb.o: exeb.c zport.h tecoc.h defext.h
139exebar.o: exebar.c zport.h tecoc.h defext.h deferr.h
140exebsl.o: exebsl.c zport.h tecoc.h defext.h chmacs.h
141exec.o: exec.c zport.h tecoc.h defext.h
142execcc.o: execcc.c zport.h tecoc.h defext.h deferr.h
143execln.o: execln.c zport.h tecoc.h defext.h
144execom.o: execom.c zport.h tecoc.h defext.h deferr.h
145execrt.o: execrt.c zport.h tecoc.h defext.h chmacs.h deferr.h
146execst.o: execst.c zport.h tecoc.h defext.h deferr.h
147execta.o: execta.c zport.h tecoc.h defext.h dchars.h
148exectc.o: exectc.c zport.h tecoc.h defext.h dchars.h
149exectd.o: exectd.c zport.h tecoc.h defext.h
150execte.o: execte.c zport.h tecoc.h defext.h
151execti.o: execti.c zport.h tecoc.h defext.h dchars.h
152exectl.o: exectl.c zport.h tecoc.h defext.h dchars.h
153exectn.o: exectn.c zport.h tecoc.h defext.h
154execto.o: execto.c zport.h tecoc.h defext.h
155exectp.o: exectp.c zport.h tecoc.h defext.h
156exectq.o: exectq.c zport.h tecoc.h defext.h
157exectr.o: exectr.c zport.h tecoc.h defext.h deferr.h
158exects.o: exects.c zport.h tecoc.h defext.h
159exectt.o: exectt.c zport.h tecoc.h defext.h deferr.h
160exectu.o: exectu.c zport.h tecoc.h defext.h deferr.h dchars.h
161exectv.o: exectv.c zport.h tecoc.h defext.h deferr.h
162exectw.o: exectw.c zport.h tecoc.h defext.h deferr.h
163exectx.o: exectx.c zport.h tecoc.h defext.h
164execty.o: execty.c zport.h tecoc.h defext.h
165exectz.o: exectz.c zport.h tecoc.h defext.h
166exed.o: exed.c zport.h tecoc.h defext.h deferr.h
167exedgt.o: exedgt.c zport.h tecoc.h defext.h deferr.h chmacs.h
168exedot.o: exedot.c zport.h tecoc.h defext.h
169exedqu.o: exedqu.c zport.h tecoc.h defext.h deferr.h chmacs.h
170exee.o: exee.c zport.h tecoc.h defext.h chmacs.h dchars.h deferr.h
171exeequ.o: exeequ.c zport.h tecoc.h defext.h dchars.h deferr.h
172exeesc.o: exeesc.c zport.h tecoc.h defext.h dchars.h
173exeexc.o: exeexc.c zport.h tecoc.h defext.h
174exeey.o: exeey.c zport.h tecoc.h defext.h
175exef.o: exef.c zport.h tecoc.h defext.h chmacs.h deferr.h
176exefb.o: exefb.c zport.h tecoc.h defext.h deferr.h
177exeg.o: exeg.c zport.h tecoc.h defext.h deferr.h
178exegtr.o: exegtr.c zport.h tecoc.h defext.h deferr.h
179exeh.o: exeh.c zport.h tecoc.h defext.h
180exei.o: exei.c zport.h tecoc.h defext.h dchars.h deferr.h
181exeill.o: exeill.c zport.h tecoc.h defext.h deferr.h
182exej.o: exej.c zport.h tecoc.h defext.h
183exek.o: exek.c zport.h tecoc.h defext.h
184exel.o: exel.c zport.h tecoc.h defext.h
185exelbr.o: exelbr.c zport.h tecoc.h defext.h deferr.h
186exelst.o: exelst.c zport.h tecoc.h defext.h deferr.h
187exem.o: exem.c zport.h tecoc.h defext.h deferr.h
188exen.o: exen.c zport.h tecoc.h defext.h deferr.h
189exenul.o: exenul.c zport.h tecoc.h defext.h
190exenyi.o: exenyi.c zport.h tecoc.h defext.h deferr.h
191exeo.o: exeo.c zport.h tecoc.h defext.h dchars.h deferr.h
192exeopr.o: exeopr.c zport.h tecoc.h defext.h
193exep.o: exep.c zport.h tecoc.h defext.h deferr.h
194exeprc.o: exeprc.c zport.h tecoc.h defext.h deferr.h
195exepw.o: exepw.c zport.h tecoc.h defext.h
196exeq.o: exeq.c zport.h tecoc.h defext.h deferr.h
197exeqes.o: exeqes.c zport.h tecoc.h defext.h
198exer.o: exer.c zport.h tecoc.h defext.h
199exerbr.o: exerbr.c zport.h tecoc.h defext.h deferr.h
200exertp.o: exertp.c zport.h tecoc.h defext.h deferr.h
201exes.o: exes.c zport.h tecoc.h defext.h dchars.h deferr.h
202exescl.o: exescl.c zport.h tecoc.h defext.h deferr.h
203exet.o: exet.c zport.h tecoc.h defext.h dchars.h
204exeu.o: exeu.c zport.h tecoc.h defext.h deferr.h
205exeund.o: exeund.c zport.h tecoc.h defext.h deferr.h
206exeusc.o: exeusc.c zport.h tecoc.h defext.h dchars.h
207exev.o: exev.c zport.h tecoc.h defext.h
208exew.o: exew.c zport.h tecoc.h defext.h deferr.h
209exex.o: exex.c zport.h tecoc.h defext.h deferr.h
210exey.o: exey.c zport.h tecoc.h defext.h deferr.h
211exez.o: exez.c zport.h tecoc.h defext.h
212findes.o: findes.c zport.h tecoc.h defext.h deferr.h
213findqr.o: findqr.c zport.h tecoc.h defext.h deferr.h chmacs.h
214flowec.o: flowec.c zport.h tecoc.h defext.h deferr.h
215flowee.o: flowee.c zport.h tecoc.h defext.h deferr.h
216flowel.o: flowel.c zport.h tecoc.h defext.h deferr.h
217getara.o: getara.c zport.h tecoc.h defext.h deferr.h
218getnma.o: getnma.c zport.h tecoc.h defext.h deferr.h
219inccbp.o: inccbp.c zport.h tecoc.h defext.h deferr.h
220init.o: init.c zport.h tecoc.h defext.h deferr.h
221insstr.o: insstr.c zport.h tecoc.h defext.h deferr.h
222isradx.o: isradx.c zport.h tecoc.h defext.h chmacs.h
223ln2chr.o: ln2chr.c zport.h tecoc.h defext.h dchars.h chmacs.h
224makdbf.o: makdbf.c zport.h tecoc.h defext.h
225makrom.o: makrom.c zport.h tecoc.h defext.h deferr.h
226popmac.o: popmac.c zport.h tecoc.h defext.h
227pshmac.o: pshmac.c zport.h tecoc.h defext.h deferr.h
228pushex.o: pushex.c zport.h tecoc.h defext.h dchars.h deferr.h
229rdline.o: rdline.c zport.h tecoc.h defext.h deferr.h dchars.h
230rdpage.o: rdpage.c zport.h tecoc.h defext.h deferr.h
231readcs.o: readcs.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
232readcs.o: dscren.h
233replac.o: replac.c zport.h tecoc.h defext.h dchars.h
234search.o: search.c zport.h tecoc.h defext.h deferr.h dchars.h
235singlp.o: singlp.c zport.h tecoc.h defext.h dchars.h
236skpcmd.o: skpcmd.c zport.h tecoc.h defext.h chmacs.h dchars.h deferr.h
237srclop.o: srclop.c zport.h tecoc.h defext.h deferr.h
238sserch.o: sserch.c zport.h tecoc.h defext.h
239tabort.o: tabort.c zport.h tecoc.h
240typbuf.o: typbuf.c zport.h tecoc.h defext.h dchars.h chmacs.h
241typest.o: typest.c zport.h tecoc.h defext.h dchars.h
242uminus.o: uminus.c zport.h tecoc.h defext.h
243wrpage.o: wrpage.c zport.h tecoc.h defext.h dchars.h deferr.h
244zfrsrc.o: zfrsrc.c zport.h tecoc.h defext.h dchars.h chmacs.h deferr.h
245zlinux.o: zlinux.c tecoc.h clpars.h dchars.h deferr.h
246zlinux.o: defext.h dscren.h vrbmsg.h
247