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