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