Makefile.std revision 316958
1# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $
2#	Makefile.std	4.3	6/11/83
3#
4# C Shell with process control; VM/UNIX VAX Makefile
5# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
6#
7# With an input editor, command completion, etc. and ported to all sorts of
8# things; Paul Placeway, CIS Dept., Ohio State University
9#
10SHELL=/bin/sh
11VERSION=6.12
12BUILD=tcsh
13srcdir=.
14
15################################################################
16## CFLAGS.  For various -D things, see config.h
17################################################################
18#
19# These are the default suffixes from .c to .o and -c to get there
20# but to use the global optimizer on the mips boxes, see below
21#
22SUF=o
23CF=-c
24
25INCLUDES=-I. -I$(srcdir)
26
27LFLAGS=$(INCLUDES)
28#LFLAGS=$(INCLUDES) -Zn10000		# hpux lint
29
30
31#CFLAGS= $(INCLUDES) -g			# debug
32#CFLAGS= $(INCLUDES) -O			# production
33#CFLAGS= $(INCLUDES) 			# Broken optimizers....
34
35#CFLAGS= -g -pg $(INCLUDES) -DPROF
36#CFLAGS= -O -pg $(INCLUDES) -DPROF
37
38# gcc 1.00-1.37
39#CFLAGS=-O $(INCLUDES) -finline-functions -fstrength-reduce 
40
41# gcc 1.37-1.40
42#CFLAGS=-O $(INCLUDES) -fcombine-regs -finline-functions -fstrength-reduce 
43# add -msoft-float for 68881 machines.
44
45# gcc 2.0
46# On the sparc, don't use -O2; it breaks setjmp() and vfork()
47#CFLAGS=-O $(INCLUDES)
48
49# gcc-2.1+
50CFLAGS=-O2 $(INCLUDES)
51
52# lucid c on suns
53#CFLAGS=-O5 $(INCLUDES)
54
55# gcc 2.1 on linux
56#CFLAGS=-O6 -fomit-frame-pointer $(INCLUDES)
57
58# HP/UX 8.0, 9.0
59#CFLAGS= $(INCLUDES) +O3 -Aa
60
61# Ultrix 4.2a
62#CFLAGS= $(INCLUDES) -O -Olimit 2000
63
64# Intel Paragon OSF/1 with PGI compilers
65#CFLAGS=-O -Mnodebug -Mnoperfmon $(INCLUDES)
66
67# DEC Alpha OSF/1
68#CFLAGS= -O2 $(INCLUDES) -Olimit 2000	## Normal Optimization
69#CFLAGS= -O3 $(INCLUDES) -Olimit 2000	## Full Optimization - may not work
70#CF=-j
71#SUF=u
72#.SUFFIXES: .u
73
74# for silicon graphics (and other mips compilers) -- use the
75# global optimizer! (-O3).
76# On SGI 4.0+ you need to add -D__STDC__ too.
77#CFLAGS= -O3 $(INCLUDES) 
78#CFLAGS= -O3 $(INCLUDES) -Olimit 2000	## Ultrix 4.2a
79#CF=-j
80#SUF=u
81#.SUFFIXES: .u 				## Ultrix and gnu-make need that
82
83# mips systems
84# CFLAGS= $(INCLUDES) -O -systype bsd43 -Wf,-XNd5000 -Wf,-XNp6000 -Olimit 2000
85
86# for at&t machines
87#CFLAGS= -O -Ksd $(INCLUDES)
88
89# Stardent Titan
90#CFLAGS = $(INCLUDES) -O -43
91
92# Stardent Stellar or sunos4 /bin/cc or Solaris2.1 /opt/SUNWspro/bin/cc
93#CFLAGS = $(INCLUDES) -O4
94
95# Intergraph clipper CLIX 3.1
96#CFLAGS= -w -O2 $(INCLUDES)
97
98# Dnix 5.3
99#CFLAGS = -O -X7
100
101# Pyramid OS/x
102#CFLAGS = -OG
103
104# Multiflow (5M binary... if you choose -O5!)
105#CFLAGS = -O5 -sb_trace 0
106
107# DDE Supermax Unix SYSV Rel III.
108# CFLAGS= -O3
109
110# SINIX RMx00
111#CFLAGS= -O # -D_POSIX_SOURCE # -kansi
112
113# Minix-VMD
114# CFLAGS= -O -D_ANSI_H -I /usr/include/bsdcompat $(INCLUDES)
115
116# Apollo's with cc [apollo builtins don't work with gcc]
117# and apollo should not define __STDC__ if it does not have
118# the standard header files. RT's (aos4.3) need that too;
119# you might want to skip the -O on the rt's... Not very wise.
120# AIX/ESA needs -D_IBMESA on command line (this may disappear by GA)
121#DFLAGS=-U__STDC__ 
122#DFLAGS=-D_IBMESA
123# On aix2.2.1 we need more compiler space.
124#DFLAGS=-Nd4000 -Nn3000
125# AU/X 2.0 needs a flag for POSIX (read the config file)
126#DFLAGS=-Zp
127# Tektronix 4300 running UTek 4.0 (BSD 4.2) needs:
128#DFLAGS = -DUTek -DBSD
129# VMS_POSIX needs:
130#DFLAGS=-D_VMS_POSIX
131# Multiflow and PCC compilers don't like void typedefs.
132# You may also need -U__STDC__ if you use pcc (i.e. ibmrt aos4.3).
133#DFLAGS=-DMULTIFLOW
134#DFLAGS=-DPCC
135# DELL SVR4
136#DFLAGS=-DDELL
137# SCO_SV
138#DFLAGS=-D_SPEED_T -DSCO
139DFLAGS=
140#DFLAGS=-D_PATH_TCSHELL='"${DESTBIN}/tcsh"'
141
142
143################################################################
144## LDFLAGS.  Define something here if you need to
145################################################################
146LDFLAGS= 			## The simplest, suitable for all.
147#LDFLAGS= -s			## Stripped. Takes less space on disk.
148#LDFLAGS= -s -n			## Pure executable. Spares paging over
149# 				## the network for machines with local
150#				## swap but external /usr/local/bin .
151#LDFLAGS= -s -n -Bstatic	## Without dynamic linking. (SunOS/cc)
152#LDFLAGS= -s -n -static		## Without dynamic linking. (SunOS/gcc)
153#LDFLAGS= -Wl,-s,-n		## Stripped, shared text (Unicos)
154#LDFLAGS= -s -static		## Link statically. (linux)
155#LDFLAGS= -s -N			## Impure executable (linux)
156#LDFLAGS= -Bdynamic -dy		## SCO_SV
157
158################################################################
159## LIBES.  Pick one, or roll your own.
160################################################################
161LIBES= -ltermcap 			 ## BSD style things
162#LIBES= -ltermcap			 ## SunOS, HP-UX, pyramid
163#LIBES= -ltermcap			 ## Linux
164#LIBES= -ltermcap -lshadow		 ## Linux with PW_SHADOW
165#LIBES= -ltermcap -lsec			 ## Tek XD88/10 (UTekV) with PW_SHADOW
166#LIBES= -ltermcap -lsec			 ## Motorola MPC (sysV88) with PW_SHADOW
167#LIBES= -ltermcap -lcs			 ## Mach
168#LIBES= -ltermcap -lbsd			 ## DEC osf1 on the alpha
169#LIBES= -ltermcap -lbsd			 ## Intel paragon
170#LIBES= -ltermcap -lbsd			 ## Clipper intergraph
171#LIBES= -ltermcap -lseq			 ## Sequent's Dynix
172#LIBES= -ltermcap -lauth		 ## Ultrix with Enhanced Security
173#LIBES= -ltermcap -ldir -lx		 ## Xenix 386 style things
174#LIBES= -ltermcap -lndir -lsocket -ljobs ## masscomp RTU6.0
175#LIBES= -lcurses			 ## AIX on the rt
176#LIBES= -lcurses			 ## TitanOS on the stellar
177#LIBES= -ltermlib -lsocket -lnsl	 ## SysV4 w/o BSDTIMES or Solaris 2
178#LIBES= -lcurses			 ## SysV3 w/o networking
179#LIBES= -lcurses -lnet			 ## SysV3 with networking
180#LIBES= -lcurses -ldir			 ## SysV2 w/o networking & dirlib
181#LIBES= -lcurses -ldir -lnet		 ## SysV2 with networking & dirlib
182#LIBES= -lcurses -lbsd			 ## AIX on the IBM 370 or rs6000 or ps2
183#LIBES= -lcurses -lbsd			 ## ETA10
184#LIBES= -lcurses -lbsd			 ## Irix3.1 on the SGI-IRIS4D
185#LIBES= -lcurses -lbsd -lc_s		 ## Irix3.3 on the SGI-IRIS4D w/o yp
186#LIBES= -lcurses -lsun -lbsd -lc_s	 ## Irix3.3 on the SGI-IRIS4D with yp
187#LIBES= -lcurses -lsocket -lbsd		 ## Amdahl UTS 2.1
188#LIBES= -lcurses -lsocket		 ## Intel's hypercube.
189#LIBES= -lcurses -lsocket		 ## ns32000 based Opus.
190#LIBES= -lcurses -lcposix		 ## ISC 2.2 without networking
191#LIBES= -lcposix -lc_s -lcurses -linet	 ## ISC 2.2 with networking
192#LIBES= -lcurses -lsec -lc_s		 ## ISC 2.0.2 without networking
193#LIBES= -lcurses -linet -lsec -lc_s	 ## ISC 2.0.2 with networking
194#LIBES= -lcurses -lintl -lcrypt		 ## SCO SysVR3.2v2.0
195#LIBES= -lcurses -lintl -lsocket -lcrypt ## SCO+ODT1.1
196#LIBES= -lcurses -lsocket -lcrypt	 ## SCO_SV
197#LIBES= -lposix -ltermcap		 ## A/UX 2.0
198#LIBES= -lposix -ltermcap -lc_s		 ## A/UX 3.0
199#LIBES= -ldirent -lcurses		 ## att3b1 cc w/o shared lib & dirlib
200#LIBES= -shlib -ldirent -lcurses	 ## att3b1 gcc with shared lib & dirlib
201#LIBES= -ltermlib -lsocket -lnsl -lc /usr/ucblib/libucb.a ## SysV4 with BSDTIMES
202#LIBES= -lcurses -lnsl -lsocket -lc /usr/ucblib/libucb.a ## Stardent Vistra
203#LIBES= -ltermc				 ## emx under OS/2
204#LIBES=					 ## Minix, VMS_POSIX
205#LIBES= -ltermcap -lcrypt		 ## Multiflow
206#LIBES= -ltermcap -lcrypt		 ## NetBSD
207#LIBES= -lcurses 			 ## DDE Supermax
208
209################################################################
210## EXTRAFLAGS and EXTRALIBS
211################################################################
212# Compiling for HESIOD
213#HESDEF = -DHESIOD -I/usr/athena/include
214#HESLIB = -L/usr/athena/lib -lhesiod
215#
216# Compiling for AFS with kerberos authentication
217#AFSLIBDIR = /usr/afsws/lib
218#AFSDEF = -DAFS -I/usr/afsws/include
219#AFS33LIB = -laudit
220#
221#Solaris and HPUX require the BSD libraries with AFS.
222#We use -lc to use only what we require.
223#AFSAUXLIB = -lsocket -lnsl -lc -lucb                    # Solaris
224#AFSAUXLIB = -lc -lBSD                                   # HPUX   
225#
226#AFSLIB = -L$(AFSLIBDIR) -L$(AFSLIBDIR)/afs -lkauth -lprot -lubik\
227#         -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\
228#         $(AFSLIBDIR)/afs/util.a $(AFS33LIB) $(AFSAUXLIB)
229#
230
231EXTRAFLAGS = $(HESDEF) $(AFSDEF)
232EXTRALIBS = $(HESLIB) $(AFSLIB)
233
234
235# The difficult choice of a c-compiler...
236# First, you should try your own c-compiler. 
237# Gcc -traditional is also a safe choice. 
238# If you think that you have good include files try gcc -Wall...
239# If you want to take out -traditional, make sure that your sys/ioctl.h
240# is fixed correctly, otherwise you'll be stopped for tty input, or you
241# will lose the editor and job control.
242
243# This is for setting your C preprocessor value.
244CPP = ${CC} -E
245# The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
246# on the suns does not know how to make dynamically linked binaries.
247CC=	gcc -Wall -pipe -B/bin/	# -ansi -pedantic
248#CC=	gcc -m486 -pipe -Wall # Generate code for Intel 486 (linux)
249#CC=	shlicc 	# BSDI2.1 w/ shared libraries
250#CC=	cc
251#CC=	occ
252#CC=	acc
253#CC=	pcc
254#CC=	hc -w
255#CC=	c89	# For VMS/POSIX
256#CC=	/bin/cc	# For suns, w/o gcc and SVR4
257#CC=	/usr/lib/sun.compile/cc  # FPS 500 (+FPX) with Sun C compiler
258#CC=	/opt/SUNWspro/bin/cc	# Solaris 2.1
259#CC=	scc 	# Alliant fx2800
260#CC=	lcc	-wa 
261#CC=	cc -b elf -Kpic # SCO_SV
262ED=	ed
263AS=	as
264RM=	rm
265CXREF=	/usr/ucb/cxref
266#CXREF=	/bin/cxref			# SCO_SV
267VGRIND=	csh /usr/ucb/vgrind
268CTAGS=	/usr/ucb/ctags
269#CTAGS=	/usr/bin/ctags			# SCO_SV
270#XSTR= /usr/ucb/xstr
271#XSTR= /usr/bin/xstr			# SCO_SV
272SCCS=	/usr/local/sccs
273PARALLEL=12				# Make the multi-max run fast.
274#P=&					# Use Sequent's parallel make
275P=
276DESTDIR=/usr/local
277#DESTDIR=/usr/contrib
278MANSECT=1
279DESTBIN=${DESTDIR}/bin
280DESTMAN=${DESTDIR}/man/man${MANSECT}
281# DESTMAN=${DESTDIR}/catman/man${MANSECT}	 # A/UX
282# DESTMAN=${DESTDIR}/usr/share/man/man${MANSECT} # Stardent Vistra (SysVR4)
283# DESTMAN=/usr/catman/1l			 # Amiga unix (SysVR4)
284FTPAREA=/usr/spool/ftp
285
286ASSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
287	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
288	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
289	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h 
290PSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
291	vms.termcap.c
292SHSRCS= ${ASSRCS} ${PSSRCS}
293SHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
294	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
295	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
296	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
297	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \
298	mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF}
299
300TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
301	tw.comp.c tw.color.c
302TWOBJS=	tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
303	tw.comp.${SUF} tw.color.${SUF}
304
305EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
306	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
307EDOBJS=	ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
308	ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
309
310TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
311	tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
312	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
313	tc.who.c tc.h
314TCOBJS=	tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
315	tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} tc.printf.${SUF} \
316	tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
317	tc.vers.${SUF} tc.who.${SUF} 
318
319PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32
320AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
321	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
322	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
323	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
324	host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \
325	aclocal.m4
326
327VHSRCS=${PVSRCS} ${AVSRCS}
328
329CONFSRCS=config/* 
330
331ALLSRCS=  ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS}
332DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS}
333
334
335OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS}
336
337
338all: ${BUILD}
339
340tcsh:$(P) ${OBJS} 
341	rm -f tcsh core
342	${CC} -o tcsh ${LDFLAGS} ${CFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
343
344# Purify
345pure:$(P) ${OBJS} 
346	rm -f tcsh core
347	purify `echo ${CC} | sed -e s,-B/bin/,,` -o tcsh ${LDFLAGS} ${CFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
348# OS/2
349tcsh.exe: tcsh
350	emxbind tcsh
351
352gethost:  gethost.c sh.err.h tc.const.h sh.h
353	rm -f gethost
354	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${DFLAGS} $(srcdir)/gethost.c ${LIBES} ${EXTRALIBS}
355
356tc.defs.c:	gethost host.defs
357	@rm -f $@
358	@echo "/* Do not edit this file, make creates it */" > $@
359	./gethost $(srcdir)/host.defs >> $@
360
361tcsh.ps: tcsh.man
362	rm -f tcsh.ps
363	-ptroff -t -man $(srcdir)/tcsh.man > tcsh.ps
364
365
366.c.${SUF}:
367	${CC} ${CF} ${CFLAGS} ${DFLAGS} ${EXTRAFLAGS} $<
368
369# _VMS_POSIX #module addition
370#.c.${SUF}:
371#	@(echo '#module '`echo $< | sed -e 's/\./_/g'`; cat $<) > $*..c
372#	@echo ${CC} ${CF} ${CFLAGS} ${DFLAGS} ${EXTRAFLAGS} $*.c
373#	@${CC} ${CF} ${CFLAGS} ${DFLAGS} ${EXTRAFLAGS} $*..c
374#	@mv $*..o $*.o
375#	@rm -f $*..c
376
377
378# Don't do any special massaging of C files for sharing of strings!!
379# it causes weird segmentation faults on some systems.
380#.c.o:
381#	${CPP} ${CFLAGS} $*.c | ${XSTR} -c -
382#	${CC} ${CF} ${CFLAGS} x.c 
383#	mv -f x.o $*.o
384#	rm -f x.c
385
386#ed.init.o: ed.init.c
387#	${CPP} ${CFLAGS} $*.c | ${XSTR} -c -
388#	${CC} -R ${CF} ${CF} x.c 
389#	mv -f x.o $*.o
390#	rm -f x.c
391
392#strings.o: strings
393#	${XSTR}
394#	${CC} -c -R xs.c
395#	mv -f xs.o strings.o
396#	rm -f xs.c
397
398##.DEFAULT:
399##	${SCCS} get $<
400
401##.DEFAULT:
402##	co $<
403
404ed.defns.h: ed.defns.c
405	@rm -f $@
406	@echo '/* Do not edit this file, make creates it. */' > $@
407	@echo '#ifndef _h_ed_defns' >> $@
408	@echo '#define _h_ed_defns' >> $@
409	grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@
410	@echo '#endif /* _h_ed_defns */' >> $@
411
412sh.err.h: sh.err.c
413	@rm -f $@
414	@echo '/* Do not edit this file, make creates it. */' > $@
415	@echo '#ifndef _h_sh_err' >> $@
416	@echo '#define _h_sh_err' >> $@
417	grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@
418	@echo '#endif /* _h_sh_err */' >> $@
419
420tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
421	@rm -f $@
422	@echo '/* Do not edit this file, make creates it. */' > $@
423	@echo '#ifndef _h_tc_const' >> $@
424	@echo '#define _h_tc_const' >> $@
425	${CPP} $(INCLUDES) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
426	    $(srcdir)/tc.const.c | grep 'Char STR' | \
427	    sed -e 's/Char \([a-zA-Z0-9_]*\) *\[ *\].*/extern Char \1[];/' | \
428	    LC_COLLATE=C sort >> $@
429	@echo '#endif /* _h_tc_const */' >> $@
430
431csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
432	rm -f csh.prof
433	ld -X mcrt0.${SUF} ${OBJS} -o csh.prof ${LIBES} -lc
434
435sh.prof.${SUF}:
436	cp sh.c sh.prof.c
437	${CC} ${CF} ${CFLAGS} -DPROF sh.prof.c
438
439lint: tc.const.h ed.defns.h
440	lint ${DFLAGS} ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES}
441
442alint: tc.const.h ed.defns.h
443	alint ${DFLAGS} ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES}
444
445print:
446	@pr READ_ME
447	@pr makefile makefile.*
448	@(size -l a.out; size *.${SUF}) | pr -h SIZES
449	@${CXREF} sh*.c | pr -h XREF
450	@ls -l | pr 
451	@pr sh*.h [a-rt-z]*.h sh*.c alloc.c
452
453vprint:
454	@pr -l84 READ_ME TODO
455	@pr -l84 makefile makefile.*
456	@(size -l a.out; size *.${SUF}) | pr -l84 -h SIZES
457	@${CXREF} sh*.c | pr -l84 -h XREF
458	@ls -l | pr -l84
459	@${CXREF} sh*.c | pr -l84 -h XREF
460	@pr -l84 sh*.h [a-rt-z]*.h sh*.c alloc.c
461
462vgrind:
463	@cp /dev/null index
464	@for i in *.h; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
465	@for i in *.c; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
466	@vgrind -t -x -h Index index >/crp/bill/csh/index.t
467
468install: tcsh 
469	-mv -f ${DESTBIN}/tcsh  ${DESTBIN}/tcsh.old
470	cp tcsh ${DESTBIN}/tcsh
471	-strip ${DESTBIN}/tcsh
472	chmod 555 ${DESTBIN}/tcsh
473
474install.man: tcsh.man
475	-rm -f ${DESTMAN}/tcsh.${MANSECT}
476	cp $(srcdir)/tcsh.man ${DESTMAN}/tcsh.${MANSECT}
477	chmod 444 ${DESTMAN}/tcsh.${MANSECT}
478
479# Amiga Unix
480#install.man: tcsh.man
481#        compress tcsh.man
482#	cp tcsh.man.Z ${DESTMAN}/tcsh.Z
483#	chmod 444 ${DESTMAN}/tcsh.Z
484
485# Apple A/UX
486#install.man: tcsh.man
487#	-rm -f ${DESTMAN}/tcsh.${MANSECT}.Z
488#	nroff -man tcsh.man | compress > ${DESTMAN}/tcsh.${MANSECT}.Z
489#	chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z
490
491clean:
492	${RM} -f a.out strings x.c xs.c tcsh tcsh.a _MAKE_LOG core gethost
493	${RM} -f *.${SUF} sh.prof.c ed.defns.h tc.const.h sh.err.h tc.defs.c
494	${RM} -f tcsh.*.m tcsh.*.cat
495
496veryclean: clean
497	${RM} -f config.h config.status config.cache config.log Makefile tcsh.ps
498	${RM} -f *~ #*
499
500distclean: veryclean
501
502tags:	/tmp
503	${CTAGS} sh*.c
504
505tar.Z:
506	rm -f tcsh-${VERSION}.tar.Z
507	rm -rf tcsh-${VERSION} 
508	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
509	cp ${ALLSRCS} tcsh-${VERSION}
510	cp ${CONFSRCS} tcsh-${VERSION}/config
511	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
512	tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
513	rm -rf tcsh-${VERSION}
514
515tar.gz:
516	rm -f tcsh-${VERSION}.tar.gz
517	rm -rf tcsh-${VERSION} 
518	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
519	cp ${ALLSRCS} tcsh-${VERSION}
520	cp ${CONFSRCS} tcsh-${VERSION}/config
521	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
522	tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
523	rm -rf tcsh-${VERSION}
524
525shar:
526	rm -f tcsh-*.shar
527	rm -rf tcsh-${VERSION} 
528	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
529	cp ${ALLSRCS} tcsh-${VERSION}
530	cp ${CONFSRCS} tcsh-${VERSION}/config
531	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
532	MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
533		 tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
534		 tcsh-${VERSION}/?*/set?*
535	rm -rf tcsh-${VERSION}
536
537catalogs:
538	@(cd nls; make catalogs)
539
540tcsh-${VERSION}.tar.Z:
541	rm -rf tcsh-${VERSION} 
542	rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123]
543	mkdir tcsh-${VERSION}
544	./MAKEDIFFS bsd
545	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION}
546	cp ${DISTSRCS} tcsh-${VERSION}
547	mkdir tcsh-${VERSION}/config
548	cp ${CONFSRCS} tcsh-${VERSION}/config
549	cp Makefile tcsh-${VERSION}/Makefile.new
550	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
551	tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
552	rm -rf tcsh-${VERSION}
553
554tcsh.tahoe-${VERSION}.tar.Z:
555	rm -rf tcsh.tahoe-${VERSION} 
556	rm -f tcsh.tahoe-${VERSION}.tar tcsh.tahoe-${VERSION}.tar.Z DIFFS.[123]
557	mkdir tcsh.tahoe-${VERSION}
558	./MAKEDIFFS tahoe
559	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.tahoe-${VERSION}
560	cp ${DISTSRCS} tcsh.tahoe-${VERSION}
561	mkdir tcsh.tahoe-${VERSION}/config
562	cp ${CONFSRCS} tcsh.tahoe-${VERSION}/config
563	cp Makefile tcsh.tahoe-${VERSION}/Makefile.new
564	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
565	tar cvf - tcsh.tahoe-${VERSION} | compress > tcsh.tahoe-${VERSION}.tar.Z
566	rm -rf tcsh.tahoe-${VERSION}
567
568tcsh.reno-${VERSION}.tar.Z:
569	rm -rf tcsh.reno-${VERSION} 
570	rm -f tcsh.reno-${VERSION}.tar tcsh.reno-${VERSION}.tar.Z DIFFS.[123]
571	mkdir tcsh.reno-${VERSION}
572	./MAKEDIFFS reno
573	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.reno-${VERSION}
574	cp ${DISTSRCS} tcsh.reno-${VERSION}
575	mkdir tcsh.reno-${VERSION}/config
576	cp ${CONFSRCS} tcsh.reno-${VERSION}/config
577	cp Makefile tcsh.reno-${VERSION}/Makefile.new
578	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
579	tar cvf - tcsh.reno-${VERSION} | compress > tcsh.reno-${VERSION}.tar.Z
580	rm -rf tcsh.reno-${VERSION}
581
582ftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z
583	cp tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z ${FTPAREA}
584	cp tcsh.man ${FTPAREA}
585
586autoconfigure: $(srcdir)/configure $(srcdir)/config.h.in
587
588$(srcdir)/configure: $(srcdir)/configure.ac
589	cd $(srcdir) && autoconf
590
591$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
592$(srcdir)/stamp-h.in: $(srcdir)/configure.ac
593	cd $(srcdir) && autoheader
594	@echo timestamp > $(srcdir)/stamp-h.in
595
596#
597# Dependencies
598#
599config.h: config_f.h
600
601TCH=tc.h tc.const.h tc.decls.h tc.nls.h tc.os.h tc.sig.h
602SHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
603    sh.decls.h ${TCH}
604TWH=tw.h tw.decls.h
605EDH=ed.h ed.decls.h
606
607# EDH
608EDINC=sh.${SUF} sh.func.${SUF} sh.lex.${SUF} sh.print.${SUF} sh.proc.${SUF} \
609      sh.set.${SUF} tc.bind.${SUF} tc.os.${SUF} tc.prompt.${SUF} \
610      tc.sched.${SUF} tw.parse.${SUF} tw.color.${SUF}
611${EDOBJS} ${EDINC} : ${EDH}
612
613# SHH
614${OBJS}: config.h ${SHH}
615
616# TWH
617TWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
618      sh.set.${SUF} tc.func.${SUF} tc.nls.${SUF} tw.color.${SUF}
619${TWOBJS} ${TWINC}: ${TWH}
620
621# glob.h
622glob.${SUF} sh.glob.${SUF}: glob.h
623
624# dotlock.h
625dotlock.${SUF}: dotlock.h
626
627# ed.defns.h
628EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
629${EDOBJS} ${EDDINC}: ed.defns.h
630
631# tc.defs.o
632tc.defs.${SUF}:	tc.defs.c sh.h
633