Makefile.in revision 225736
122347Spst# $tcsh: Makefile.in,v 3.40 2009/06/24 22:09:05 christos Exp $
222347Spst#	Makefile.in	4.3	6/11/83
329964Sache#
492906Smarkm# C Shell with process control; VM/UNIX VAX Makefile
522347Spst# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
622347Spst#
722347Spst# With an input editor, command completion, etc. and ported to all sorts of
822347Spst# things; Paul Placeway, CIS Dept., Ohio State University
922347Spst#
1022347SpstSHELL=/bin/sh
1122347SpstVERSION=@PACKAGE_VERSION@
1222347SpstBUILD=tcsh$(EXEEXT)
1322347SpstVPATH=@srcdir@
1422347Spstsrcdir=@srcdir@
1522347Spst
1622347Spst################################################################
1792906Smarkm## CFLAGS.  For various -D things, see config.h
1892906Smarkm################################################################
1992906Smarkm#
2092906Smarkm# These are the default suffixes from .c to .o and -c to get there
2192906Smarkm# but to use the global optimizer on the mips boxes, see below
2292906Smarkm#
2392906SmarkmSUF=o
2459118SkrisCF=-c
2559118Skris
2659118SkrisCPPFLAGS=-I. -I$(srcdir)
2759118Skris
2829964SacheLFLAGS=
2929964Sache#LFLAGS= -Zn10000		# hpux lint
3029964Sache
3129964Sache
3222347SpstCFLAGS = @CFLAGS@		# This is set by autoconf.
3322347Spst#CFLAGS= -g			# debug
3422347Spst#CFLAGS= -O			# production
3522347Spst#CFLAGS= 			# Broken optimizers....
3622347Spst
3722347Spst#CFLAGS= -g -pg -DPROF
3822347Spst#CFLAGS= -O -pg -DPROF
3922347Spst
4022347Spst# gcc 1.00-1.37
4122347Spst#CFLAGS= -O -finline-functions -fstrength-reduce 
4222347Spst
4322347Spst# gcc 1.37-1.40
4422347Spst#CFLAGS= -O -fcombine-regs -finline-functions -fstrength-reduce 
4522347Spst# add -msoft-float for 68881 machines.
4622347Spst
4722347Spst# gcc 2.0
4822347Spst# On the sparc, don't use -O2; it breaks setjmp() and vfork()
4922347Spst#CFLAGS= -O
5022347Spst
5122347Spst# gcc-2.1+
5222347Spst#CFLAGS= -O2
5322347Spst
5422347Spst# lucid c on suns
5522347Spst#CFLAGS= -O5
5622347Spst
5722347Spst# gcc 2.1 on linux
5822347Spst#CFLAGS= -O6 -fomit-frame-pointer
5922347Spst
6022347Spst# HP/UX 8.0, 9.0
6122347Spst#CFLAGS= +O3 -Aa
6222347Spst
6322347Spst# Ultrix 4.2a
6422347Spst#CFLAGS= -O -Olimit 2000
6522347Spst
6622347Spst# Intel Paragon OSF/1 with PGI compilers
6722347Spst#CFLAGS= -O -Mnodebug -Mnoperfmon
6822347Spst
6922347Spst# DEC Alpha OSF/1
7022347Spst#CFLAGS= -O2 -Olimit 2000	## Normal Optimization
7122347Spst#CFLAGS= -O3 -Olimit 2000	## Full Optimization - may not work
7222347Spst#CF=-j
7322347Spst#SUF=u
7422347Spst#.SUFFIXES: .u
7522347Spst
7622347Spst# for silicon graphics (and other mips compilers) -- use the
7722347Spst# global optimizer! (-O3).
7822347Spst# On SGI 4.0+ you need to add -D__STDC__ too.
7922347Spst#CFLAGS= -O3
8022347Spst#CFLAGS= -O3 -Olimit 2000	## Ultrix 4.2a
8122347Spst#CF=-j
8222347Spst#SUF=u
8322347Spst#.SUFFIXES: .u 				## Ultrix and gnu-make need that
8422347Spst
8522347Spst# mips systems
8622347Spst# CFLAGS= -O -systype bsd43 -Wf,-XNd5000 -Wf,-XNp6000 -Olimit 2000
8722347Spst
8822347Spst# for at&t machines
8922347Spst#CFLAGS= -O -Ksd
9022347Spst
9122347Spst# Stardent Titan
9222347Spst#CFLAGS = -O -43
9322347Spst
9422347Spst# Stardent Stellar or sunos4 /bin/cc or Solaris2.1 /opt/SUNWspro/bin/cc
9522347Spst#CFLAGS = -O4
9622347Spst
9722347Spst# Intergraph clipper CLIX 3.1
9822347Spst#CFLAGS= -w -O2
9922347Spst
10022347Spst# Dnix 5.3
10122347Spst#CFLAGS = -O -X7
10222347Spst
10322347Spst# Pyramid OS/x
10422347Spst#CFLAGS = -OG
10522347Spst
10622347Spst# Multiflow (5M binary... if you choose -O5!)
10722347Spst#CFLAGS = -O5 -sb_trace 0
10822347Spst
10922347Spst# DDE Supermax Unix SYSV Rel III.
11022347Spst# CFLAGS= -O3
11122347Spst
11222347Spst# SINIX RMx00
11322347Spst#CFLAGS= -O # -D_POSIX_SOURCE # -kansi
11422347Spst
11522347Spst# Apollo's with cc [apollo builtins don't work with gcc]
11622347Spst# and apollo should not define __STDC__ if it does not have
11722347Spst# the standard header files. RT's (aos4.3) need that too;
11822347Spst# you might want to skip the -O on the rt's... Not very wise.
11922347Spst# AIX/ESA needs -D_IBMESA on command line (this may disappear by GA)
12022347Spst#DFLAGS=-U__STDC__ 
12122347Spst#DFLAGS=-D_IBMESA
12222347Spst# On aix2.2.1 we need more compiler space.
12322347Spst#DFLAGS=-Nd4000 -Nn3000
12422347Spst# AU/X 2.0 needs a flag for POSIX (read the config file)
12522347Spst#DFLAGS=-Zp
12622347Spst# Tektronix 4300 running UTek 4.0 (BSD 4.2) needs:
12722347Spst#DFLAGS = -DUTek -DBSD
12822347Spst# VMS_POSIX needs:
12922347Spst#DFLAGS=-D_VMS_POSIX
13022347Spst# Multiflow and PCC compilers don't like void typedefs.
13122347Spst# You may also need -U__STDC__ if you use pcc (i.e. ibmrt aos4.3).
13222347Spst#DFLAGS=-DMULTIFLOW
13322347Spst#DFLAGS=-DPCC
13422347Spst# DELL SVR4
13522347Spst#DFLAGS=-DDELL
13622347Spst#DFLAGS=
13722347Spst#DFLAGS=-D_PATH_TCSHELL='"${DESTBIN}/tcsh"'
13822347Spst## The following is set by autoconf.
13922347SpstDFLAGS = -D_PATH_TCSHELL='"${bindir}/tcsh"' @DFLAGS@ @CPPFLAGS@
14022347Spst
14129964Sache
14229964Sache################################################################
14329964Sache## LDFLAGS.  Define something here if you need to
14422347Spst################################################################
14522347SpstLDFLAGS= @LDFLAGS@		## This is set by autoconf.
14622347Spst#LDFLAGS= 			## The simplest, suitable for all.
14722347Spst#LDFLAGS= -s			## Stripped. Takes less space on disk.
14822347Spst#LDFLAGS= -s -n			## Pure executable. Spares paging over
14922347Spst# 				## the network for machines with local
15022347Spst#				## swap but external /usr/local/bin .
15122347Spst#LDFLAGS= -s -n -Bstatic	## Without dynamic linking. (SunOS/cc)
15222347Spst#LDFLAGS= -s -n -static		## Without dynamic linking. (SunOS/gcc)
15322347Spst#LDFLAGS= -Wl,-s,-n		## Stripped, shared text (Unicos)
15422347Spst#LDFLAGS= -s -static		## Link statically. (linux)
15522347Spst#LDFLAGS= -s -N			## Impure executable (linux)
15622347Spst
15722347Spst################################################################
15822347Spst## SBINLDFLAGS.  Flags to build a tcsh suitable for installation in
15922347Spst##		 in /sbin under Solaris with gcc. See the "tcsh.sbin"
16022347Spst##		 target.
16122347Spst################################################################
16222347SpstSBINLDFLAGS=-Wl,-R/etc/lib,-I/etc/lib/ld.so.1,-ldl,-Bstatic
16322347Spst
16422347Spst################################################################
16522347Spst## LIBES.  Pick one, or roll your own.
16622347Spst################################################################
16792906SmarkmLIBES= @LIBS@	 			 ## This is set by autoconf.
16822347Spst#LIBES= -ltermcap 			 ## BSD style things
16922347Spst#LIBES= -ltermcap			 ## SunOS, HP-UX, pyramid
17022347Spst#LIBES= -ltermcap			 ## Linux
17122347Spst#LIBES= -ltermcap -lshadow		 ## Linux with PW_SHADOW
17292906Smarkm#LIBES= -ltermcap -lsec			 ## Tek XD88/10 (UTekV) with PW_SHADOW
17392906Smarkm#LIBES= -ltermcap -lsec			 ## Motorola MPC (sysV88) with PW_SHADOW
17422347Spst#LIBES= -ltermcap -lcs			 ## Mach
17522347Spst#LIBES= -ltermcap -lbsd			 ## DEC osf1 on the alpha
17622347Spst#LIBES= -ltermcap -lbsd			 ## Intel paragon
17722347Spst#LIBES= -ltermcap -lbsd			 ## Clipper intergraph
17822347Spst#LIBES= -ltermcap -lseq			 ## Sequent's Dynix
17922347Spst#LIBES= -ltermcap -lauth		 ## Ultrix with Enhanced Security
18022347Spst#LIBES= -ltermcap -ldir -lx		 ## Xenix 386 style things
18122347Spst#LIBES= -ltermcap -lndir -lsocket -ljobs ## masscomp RTU6.0
18222347Spst#LIBES= -lcurses			 ## AIX on the rt
18322347Spst#LIBES= -lcurses			 ## TitanOS on the stellar
18422347Spst#LIBES= -ltermlib -lsocket -lnsl	 ## SysV4 w/o BSDTIMES or Solaris 2
18522347Spst#LIBES= -lcurses			 ## SysV3 w/o networking
18622347Spst#LIBES= -lcurses -lnet			 ## SysV3 with networking
18722347Spst#LIBES= -lcurses -ldir			 ## SysV2 w/o networking & dirlib
18822347Spst#LIBES= -lcurses -ldir -lnet		 ## SysV2 with networking & dirlib
18922347Spst#LIBES= -lcurses -lbsd			 ## AIX on the IBM 370 or rs6000 or ps2
19022347Spst#LIBES= -lcurses -lbsd			 ## ETA10
19122347Spst#LIBES= -lcurses -lbsd			 ## Irix3.1 on the SGI-IRIS4D
19222347Spst#LIBES= -lcurses -lbsd -lc_s		 ## Irix3.3 on the SGI-IRIS4D w/o yp
19322347Spst#LIBES= -lcurses -lsun -lbsd -lc_s	 ## Irix3.3 on the SGI-IRIS4D with yp
19422347Spst#LIBES= -lcurses -lsocket -lbsd		 ## Amdahl UTS 2.1
19522347Spst#LIBES= -lcurses -lsocket		 ## Intel's hypercube.
19622347Spst#LIBES= -lcurses -lsocket		 ## ns32000 based Opus.
19722347Spst#LIBES= -lcurses -lcposix		 ## ISC 2.2 without networking
19822347Spst#LIBES= -lcposix -lc_s -lcurses -linet	 ## ISC 2.2 with networking
19922347Spst#LIBES= -lcurses -lsec -lc_s		 ## ISC 2.0.2 without networking
20022347Spst#LIBES= -lcurses -linet -lsec -lc_s	 ## ISC 2.0.2 with networking
20122347Spst#LIBES= -lcurses -lintl -lcrypt		 ## SCO SysVR3.2v2.0
20222347Spst#LIBES= -lcurses -lintl -lsocket -lcrypt ## SCO+ODT1.1
20322347Spst#LIBES= -lposix -ltermcap		 ## A/UX 2.0
20422347Spst#LIBES= -lposix -ltermcap -lc_s		 ## A/UX 3.0
20522347Spst#LIBES= -ldirent -lcurses		 ## att3b1 cc w/o shared lib & dirlib
20622347Spst#LIBES= -shlib -ldirent -lcurses	 ## att3b1 gcc with shared lib & dirlib
20722347Spst#LIBES= -ltermlib -lsocket -lnsl -lc /usr/ucblib/libucb.a ## SysV4 with BSDTIMES
20822347Spst#LIBES= -lcurses -lnsl -lsocket -lc /usr/ucblib/libucb.a ## Stardent Vistra
20922347Spst#LIBES= -ltermc				 ## emx under OS/2
21022347Spst#LIBES=					 ## Minix, VMS_POSIX
21122347Spst#LIBES= -ltermcap -lcrypt		 ## Multiflow
21222347Spst#LIBES= -ltermcap -lcrypt		 ## NetBSD
21322347Spst#LIBES= -lcurses 			 ## DDE Supermax
21422347Spst
21522347Spst################################################################
21622347Spst## EXTRAFLAGS and EXTRALIBS
21722347Spst################################################################
21892906Smarkm# Compiling for AFS with kerberos authentication
21992906Smarkm#AFSLIBDIR = /usr/afsws/lib
22092906Smarkm#AFSDEF = -DAFS -I/usr/afsws/include
22122347Spst#AFS33LIB = -laudit
22222347Spst#
22322347Spst#Solaris and HPUX require the BSD libraries with AFS.
22422347Spst#We use -lc to use only what we require.
22522347Spst#AFSAUXLIB = -lsocket -lnsl -lc -lucb                    # Solaris
22622347Spst#AFSAUXLIB = -lc -lBSD                                   # HPUX   
22722347Spst#
22822347Spst#AFSLIB = -L$(AFSLIBDIR) -L$(AFSLIBDIR)/afs -lkauth -lprot -lubik\
22922347Spst#         -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\
23022347Spst#         $(AFSLIBDIR)/afs/util.a $(AFS33LIB) $(AFSAUXLIB)
23122347Spst#
23222347Spst
23322347SpstEXTRAFLAGS = @HESDEF@ $(AFSDEF)
23422347SpstEXTRALIBS = @HESLIB@ $(AFSLIB) @LIBICONV@
23522347Spst
23622347Spst
23722347Spst
23822347Spst# The difficult choice of a c-compiler...
23922347Spst# First, you should try your own c-compiler. 
24022347Spst# Gcc -traditional is also a safe choice. 
24122347Spst# If you think that you have good include files try gcc -Wall...
24222347Spst# If you want to take out -traditional, make sure that your sys/ioctl.h
24322347Spst# is fixed correctly, otherwise you'll be stopped for tty input, or you
24422347Spst# will lose the editor and job control.
24522347Spst
24622347Spst# This is for setting your C preprocessor value.
24722347SpstCPP = @CPP@ # This is set by autoconf.
24822347Spst# The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
24922347Spst# on the suns does not know how to make dynamically linked binaries.
25022347SpstCC = @CC@ # This is set by autoconf.
25122347Spst#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
25222347Spst#CC=	gcc -Wall -pipe -B/bin/	# -ansi -pedantic
25322347Spst#CC=	gcc -m486 -pipe -Wall # Generate code for Intel 486 (linux)
25422347Spst#CC=	shlicc 	# BSDI2.1 w/ shared libraries
25522347Spst#CC=	cc
25622347Spst#CC=	occ
25722347Spst#CC=	acc
25822347Spst#CC=	pcc
25922347Spst#CC=	hc -w
26022347Spst#CC=	c89	# For VMS/POSIX
26122347Spst#CC=	/bin/cc	# For suns, w/o gcc and SVR4
26222347Spst#CC=	/usr/lib/sun.compile/cc  # FPS 500 (+FPX) with Sun C compiler
26322347Spst#CC=	/opt/SUNWspro/bin/cc	# Solaris 2.1
26422347Spst#CC=	scc 	# Alliant fx2800
26522347Spst#CC=	cc	-h0,ansi,novector,float0 # for NEC SX-4
26622347Spst#CC=	lcc	-wa 
26722347SpstED=	ed
26822347SpstAS=	as
26922347SpstRM=	rm
27022347SpstCXREF=	/usr/ucb/cxref
27122347SpstVGRIND=	csh /usr/ucb/vgrind
27222347SpstCTAGS=	/usr/ucb/ctags
27322347Spst#XSTR= /usr/ucb/xstr
27422347SpstSCCS=	/usr/local/sccs
27522347SpstPARALLEL=12				# Make the multi-max run fast.
27622347Spst#P=&					# Use Sequent's parallel make
27722347SpstP=
27822347Spstprefix=@prefix@
27922347Spstexec_prefix=@exec_prefix@
28022347Spstbindir=@bindir@
28122347Spstmandir=@datarootdir@/man
28222347SpstMANSECT=1
28322347SpstDESTBIN=${DESTDIR}${bindir}
28422347SpstDESTMAN=${DESTDIR}${mandir}/man${MANSECT}
28522347Spst# DESTMAN=${DESTDIR}/catman/man${MANSECT}	 # A/UX
28622347Spst# DESTMAN=${DESTDIR}/usr/share/man/man${MANSECT} # Stardent Vistra (SysVR4)
28722347Spst# DESTMAN=/usr/catman/1l			 # Amiga unix (SysVR4)
28822347SpstEXEEXT=@EXEEXT@
28992906SmarkmFTPAREA=/usr/spool/ftp
29022347Spst
29122347SpstASSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
29222347Spst	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
29322347Spst	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
29422347Spst	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \
29522347Spst	tw.color.c
29622347SpstPSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
29722347Spst	vms.termcap.c
29822347SpstSHSRCS= ${ASSRCS} ${PSSRCS}
29922347SpstSHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
30022347Spst	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
30122347Spst	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
30222347Spst	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
30392906Smarkm	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} \
30422347Spst	mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF}
30522347Spst
30622347SpstTWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
30722347Spst	tw.comp.c tw.color.c
30822347SpstTWOBJS=	tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
30922347Spst	tw.comp.${SUF} tw.color.${SUF}
31022347Spst
31122347SpstEDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
31222347Spst	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
31322347SpstEDOBJS=	ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
31492906Smarkm	ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
31592906Smarkm
31622347SpstTCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
31722347Spst	tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
31822347Spst	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
31922347Spst	tc.who.c tc.h
32022347SpstTCOBJS=	tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
32122347Spst	tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} tc.printf.${SUF} \
32222347Spst	tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
32322347Spst	tc.vers.${SUF} tc.who.${SUF} 
32422347Spst
32592906SmarkmPVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32
32692906SmarkmAVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
32792906Smarkm	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
32892906Smarkm	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
32922347Spst	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
33022347Spst	host.defs gethost.c tcsh.man2html configure.in configure config.h.in \
33122347Spst	tests/testsuite.at
33222347SpstTESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \
33322347Spst	tests/expr.at tests/lexical.at tests/mb-eucjp.at tests/mb-utf8.at \
33422347Spst	tests/noexec.at tests/syntax.at tests/subst.at tests/variables.at \
33522347Spst	tests/sh.dol.at
33622347Spst
33722347SpstVHSRCS=${PVSRCS} ${AVSRCS}
33822347Spst
33922347SpstCONFSRCS=config/* 
34022347Spst
34122347SpstALLSRCS=  ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS}
34222347SpstDISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS} $(TESTFILES)
34322347Spst
34429964Sache
34522347SpstOBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS}
34622347Spst
34722347Spst
34822347Spstall: ${BUILD}
34922347Spst
35022347Spsttcsh$(EXEEXT):$(P) ${OBJS} 
35122347Spst	rm -f tcsh$(EXEEXT) core
35222347Spst	${CC} -o tcsh$(EXEEXT) ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
35322347Spst
35422347Spsttcsh.sbin:$(P) ${OBJS} 
35522347Spst	rm -f tcsh.sbin core
35622347Spst	${CC} -o tcsh.sbin ${SBINLDFLAGS} ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
35722347Spst
35822347Spst# Purify
35922347Spstpure:$(P) ${OBJS} 
36022347Spst	rm -f tcsh$(EXEEXT) core
36122347Spst	purify `echo ${CC} | sed -e s,-B/bin/,,` -o tcsh$(EXEEXT) ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
36222347Spst# OS/2
36322347Spst#tcsh.exe: tcsh
36422347Spst#	emxbind tcsh
36522347Spst
36622347Spstgethost:  gethost.c sh.err.h tc.const.h sh.h
36722347Spst	rm -f gethost
36822347Spst	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} $(srcdir)/gethost.c ${LIBES} ${EXTRALIBS}
36922347Spst
37022347Spsttc.defs.c:	gethost host.defs
37122347Spst	@rm -f $@.tmp
37222347Spst	@echo "/* Do not edit this file, make creates it */" > $@.tmp
37322347Spst	./gethost $(srcdir)/host.defs >> $@.tmp
37422347Spst	@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
37522347Spst
37622347Spsttcsh.ps: tcsh.man
37722347Spst	rm -f tcsh.ps
37822347Spst	-ptroff -t -man $(srcdir)/tcsh.man > tcsh.ps
37922347Spst
38022347Spst.c.${SUF}:
38122347Spst	${CC} ${CF} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $<
38222347Spst
38322347Spst.SUFFIXES: .s .i
38422347Spst
38522347Spst.c.i:
38622347Spst	${CC} -E ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $< | cat -s > $@
38722347Spst
38822347Spst.c.s:
38922347Spst	${CC} -S ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $<
39022347Spst
39122347Spst# _VMS_POSIX #module addition
39222347Spst#.c.${SUF}:
39322347Spst#	@(echo '#module '`echo $< | sed -e 's/\./_/g'`; cat $<) > $*..c
39422347Spst#	@echo ${CC} ${CF} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $*.c
39522347Spst#	@${CC} ${CF} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${EXTRAFLAGS} $*..c
39622347Spst#	@mv $*..o $*.o
39722347Spst#	@rm -f $*..c
39822347Spst
39922347Spst
40022347Spst# Don't do any special massaging of C files for sharing of strings!!
40122347Spst# it causes weird segmentation faults on some systems.
40222347Spst#.c.o:
40322347Spst#	${CPP} ${CFLAGS} ${CPPFLAGS} $*.c | ${XSTR} -c -
40422347Spst#	${CC} ${CF} ${CFLAGS} ${CPPFLAGS} x.c 
40522347Spst#	mv -f x.o $*.o
40622347Spst#	rm -f x.c
40722347Spst
40822347Spst#ed.init.o: ed.init.c
40922347Spst#	${CPP} ${CFLAGS} ${CPPFLAGS} $*.c | ${XSTR} -c -
41022347Spst#	${CC} -R ${CF} ${CFLAGS} ${CPPFLAGS} x.c 
41122347Spst#	mv -f x.o $*.o
41222347Spst#	rm -f x.c
41322347Spst
41422347Spst#strings.o: strings
41522347Spst#	${XSTR}
41622347Spst#	${CC} -c -R xs.c
41722347Spst#	mv -f xs.o strings.o
41822347Spst#	rm -f xs.c
41922347Spst
42022347Spst##.DEFAULT:
42122347Spst##	${SCCS} get $<
42222347Spst
42322347Spst##.DEFAULT:
42422347Spst##	co $<
42522347Spst
42622347Spsted.defns.h: ed.defns.c
42722347Spst	@rm -f $@.tmp
42822347Spst	@echo '/* Do not edit this file, make creates it. */' > $@.tmp
42922347Spst	@echo '#ifndef _h_ed_defns' >> $@.tmp
43022347Spst	@echo '#define _h_ed_defns' >> $@.tmp
43122347Spst	grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@.tmp
43222347Spst	@echo '#endif /* _h_ed_defns */' >> $@.tmp
43322347Spst	@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
43422347Spst
43522347Spstsh.err.h: sh.err.c
43622347Spst	@rm -f $@.tmp
43722347Spst	@echo '/* Do not edit this file, make creates it. */' > $@.tmp
43822347Spst	@echo '#ifndef _h_sh_err' >> $@.tmp
43922347Spst	@echo '#define _h_sh_err' >> $@.tmp
44022347Spst	grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@.tmp
44122347Spst	@echo '#endif /* _h_sh_err */' >> $@.tmp
44222347Spst	@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
44322347Spst
44422347Spsttc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
44522347Spst	@rm -f $@.tmp
44622347Spst	@echo '/* Do not edit this file, make creates it. */' > $@.tmp
44722347Spst	@echo '#ifndef _h_tc_const' >> $@.tmp
44822347Spst	@echo '#define _h_tc_const' >> $@.tmp
44922347Spst	${CPP} $(CPPFLAGS) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
45022347Spst	    $(srcdir)/tc.const.c | \
45122347Spst	    sed -n -e 's/^\(Char STR[a-zA-Z0-9_]*\) *\[ *\].*/extern \1[];/p' | \
45222347Spst	    sort >> $@.tmp
45322347Spst	@echo '#endif /* _h_tc_const */' >> $@.tmp
45422347Spst	@if [ -f $@ ] && cmp -s $@.tmp $@; then echo $@ unchanged.; rm -f $@.tmp; else mv -f $@.tmp $@; echo $@ recreated.; fi
45522347Spst
45622347Spst$(srcdir)/tests/package.m4: $(srcdir)/configure.in
45722347Spst	{								   \
45822347Spst	  echo '# Signature of the current package.';			   \
45922347Spst	  echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])';	   \
46022347Spst	  echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])';   \
46122347Spst	  echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])';   \
46222347Spst	  echo 'm4_define([AT_PACKAGE_STRING],    [@PACKAGE_STRING@])';	   \
46322347Spst	  echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
46422347Spst	} >$(srcdir)/tests/package.m4
46522347Spst
46622347Spst$(srcdir)/tests/testsuite: $(srcdir)/tests/package.m4 $(srcdir}/tests/testsuite.at $(TESTFILES)
46722347Spst	autom4te --language=autotest -I $(srcdir)/tests \
46822347Spst		$(srcdir)/tests/testsuite.at -o $@.tmp
46922347Spst	mv $@.tmp $@
47022347Spst
47122347Spstatconfig: config.status
47222347Spst	$(SHELL) ./config.status ./atconfig
47322347Spst
47422347Spst
47522347Spstcsh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
47622347Spst	rm -f csh.prof
47722347Spst	ld -X mcrt0.${SUF} ${OBJS} -o csh.prof ${LIBES} -lc
47822347Spst
47922347Spstsh.prof.${SUF}:
48022347Spst	cp sh.c sh.prof.c
48122347Spst	${CC} ${CF} ${CFLAGS} ${CPPFLAGS} -DPROF sh.prof.c
48222347Spst
48322347Spstlint: tc.const.h ed.defns.h
48422347Spst	lint ${DFLAGS} ${CPPFLAGS} ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES}
48522347Spst
48622347Spstalint: tc.const.h ed.defns.h
48722347Spst	alint ${DFLAGS} ${CPPFLAGS} ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES}
48822347Spst
48922347Spstprint:
49022347Spst	@pr READ_ME
49122347Spst	@pr makefile makefile.*
49222347Spst	@(size -l a.out; size *.${SUF}) | pr -h SIZES
49322347Spst	@${CXREF} sh*.c | pr -h XREF
49422347Spst	@ls -l | pr 
49522347Spst	@pr sh*.h [a-rt-z]*.h sh*.c alloc.c
49622347Spst
49722347Spstvprint:
49822347Spst	@pr -l84 READ_ME TODO
49922347Spst	@pr -l84 makefile makefile.*
50022347Spst	@(size -l a.out; size *.${SUF}) | pr -l84 -h SIZES
50122347Spst	@${CXREF} sh*.c | pr -l84 -h XREF
50222347Spst	@ls -l | pr -l84
50322347Spst	@${CXREF} sh*.c | pr -l84 -h XREF
50422347Spst	@pr -l84 sh*.h [a-rt-z]*.h sh*.c alloc.c
50522347Spst
50622347Spstvgrind:
50722347Spst	@cp /dev/null index
50822347Spst	@for i in *.h; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
50922347Spst	@for i in *.c; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
51022347Spst	@vgrind -t -x -h Index index >/crp/bill/csh/index.t
51122347Spst
51222347Spstinstall-strip: install
51322347Spst
51422347Spstinstall: tcsh$(EXEEXT) 
51522347Spst	-mkdir -p ${DESTBIN}
51622347Spst	-mv -f ${DESTBIN}/tcsh$(EXEEXT)  ${DESTBIN}/tcsh.old
51722347Spst	cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT)
51822347Spst	-strip ${DESTBIN}/tcsh$(EXEEXT)
51922347Spst	chmod 755 ${DESTBIN}/tcsh$(EXEEXT)
52022347Spst
52122347Spstinstall.man: tcsh.man
52222347Spst	-mkdir -p ${DESTMAN}
52322347Spst	-rm -f ${DESTMAN}/tcsh.${MANSECT}
52422347Spst	cp $(srcdir)/tcsh.man ${DESTMAN}/tcsh.${MANSECT}
52522347Spst	chmod 444 ${DESTMAN}/tcsh.${MANSECT}
52622347Spst
52722347Spstinstall.cygwin: install install.man
52822347Spst	-mkdir -p ${DESTDIR}${prefix}/share/doc/tcsh
52922347Spst	cp ${srcdir}/FAQ ${srcdir}/Fixes ${DESTDIR}${prefix}/share/doc/tcsh
53022347Spst	cp ${srcdir}/NewThings ${srcdir}/README ${DESTDIR}${prefix}/share/doc/tcsh
53122347Spst	cp ${srcdir}/WishList ${srcdir}/Y2K ${DESTDIR}${prefix}/share/doc/tcsh
53222347Spst	perl ${srcdir}/tcsh.man2html ${srcdir}/tcsh.man
53322347Spst	cp -rp tcsh.html ${DESTDIR}${prefix}/share/doc/tcsh
53422347Spst	-mkdir -p ${DESTDIR}/etc/defaults/etc/profile.d
53522347Spst	-mkdir -p ${DESTDIR}/etc/profile.d
53622347Spst	-mkdir -p ${DESTDIR}/etc/postinstall
53722347Spst	-mkdir -p ${DESTDIR}/etc/preremove
53822347Spst	cp -p ${srcdir}/cygwin/csh.cshrc ${DESTDIR}/etc/defaults/etc
53922347Spst	cp -p ${srcdir}/cygwin/csh.login ${DESTDIR}/etc/defaults/etc
54022347Spst	cp -p ${srcdir}/cygwin/bindkey.tcsh ${DESTDIR}/etc/defaults/etc/profile.d
54122347Spst	cp -p ${srcdir}/complete.tcsh ${DESTDIR}/etc/defaults/etc/profile.d
54222347Spst	cp -p ${srcdir}/cygwin/postinstall.sh ${DESTDIR}/etc/postinstall/tcsh.sh
54322347Spst	cp -p ${srcdir}/cygwin/preremove.sh ${DESTDIR}/etc/preremove/tcsh.sh
54422347Spst
54522347Spst# Amiga Unix
54622347Spst#install.man: tcsh.man
54722347Spst#        compress tcsh.man
54822347Spst#	cp tcsh.man.Z ${DESTMAN}/tcsh.Z
54922347Spst#	chmod 444 ${DESTMAN}/tcsh.Z
55022347Spst
55122347Spst# Apple A/UX
55222347Spst#install.man: tcsh.man
55322347Spst#	-rm -f ${DESTMAN}/tcsh.${MANSECT}.Z
55422347Spst#	nroff -man tcsh.man | compress > ${DESTMAN}/tcsh.${MANSECT}.Z
55522347Spst#	chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z
55622347Spst
55722347Spstclean:
55822347Spst	${RM} -f a.out strings x.c xs.c tcsh$(EXEEXT) tcsh.a _MAKE_LOG gethost
55922347Spst	${RM} -f *.${SUF} *.i *.s
56022347Spst	${RM} -f sh.prof.c ed.defns.h tc.const.h sh.err.h tc.defs.c
56122347Spst	${RM} -f tcsh.*.m tcsh.*.cat
56222347Spst
56322347Spstveryclean: clean
56422347Spst	${RM} -f Makefile config.h config_p.h
56522347Spst	${RM} -f config.status config.cache config.log tcsh.ps
56622347Spst	${RM} -f missing
56722347Spst	${RM} -rf autom4te.cache
56822347Spst	${RM} -f *~ #*
56922347Spst
57022347Spstdistclean: veryclean
57122347Spst
57222347Spstcleandir: veryclean
57322347Spst
57422347Spsttags:	/tmp
57522347Spst	${CTAGS} sh*.c
57622347Spst
57722347Spsttar.Z:
57822347Spst	rm -f tcsh-${VERSION}.tar.Z
57922347Spst	rm -rf tcsh-${VERSION} 
58022347Spst	-mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
58122347Spst	cp ${ALLSRCS} tcsh-${VERSION}
58222347Spst	cp ${CONFSRCS} tcsh-${VERSION}/config
58322347Spst	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
58422347Spst	tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
58522347Spst	rm -rf tcsh-${VERSION}
58622347Spst
58722347Spsttar.gz:
58822347Spst	rm -f tcsh-${VERSION}.tar.gz
58922347Spst	rm -rf tcsh-${VERSION} 
59022347Spst	-mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
59122347Spst	cp ${ALLSRCS} tcsh-${VERSION}
59222347Spst	cp ${CONFSRCS} tcsh-${VERSION}/config
59322347Spst	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
59422347Spst	tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
59522347Spst	rm -rf tcsh-${VERSION}
59622347Spst
59722347Spstshar:
59822347Spst	rm -f tcsh-*.shar
59922347Spst	rm -rf tcsh-${VERSION} 
60022347Spst	-mkdir tcsh-${VERSION} tcsh-${VERSION}/config tcsh-${VERSION}/tests
60122347Spst	cp ${ALLSRCS} tcsh-${VERSION}
60222347Spst	cp ${CONFSRCS} tcsh-${VERSION}/config
60322347Spst	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
60422347Spst	MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
60522347Spst		 tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
60622347Spst		 tcsh-${VERSION}/?*/set?*
60722347Spst	rm -rf tcsh-${VERSION}
60822347Spst
60922347Spstcatalogs:
61022347Spst	@(cd nls; make catalogs)
61122347Spst
61222347Spsttcsh-${VERSION}.tar.Z:
61322347Spst	rm -rf tcsh-${VERSION} 
61422347Spst	rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123]
61522347Spst	-mkdir tcsh-${VERSION} tcsh-${VERSION}/tests
61622347Spst	./MAKEDIFFS bsd
61722347Spst	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION}
61822347Spst	cp ${DISTSRCS} tcsh-${VERSION}
61922347Spst	-mkdir tcsh-${VERSION}/config
62022347Spst	cp ${CONFSRCS} tcsh-${VERSION}/config
62122347Spst	cp Makefile tcsh-${VERSION}/Makefile.new
62222347Spst	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
62322347Spst	tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
62422347Spst	rm -rf tcsh-${VERSION}
62522347Spst
62622347Spsttcsh.tahoe-${VERSION}.tar.Z:
62722347Spst	rm -rf tcsh.tahoe-${VERSION} 
62822347Spst	rm -f tcsh.tahoe-${VERSION}.tar tcsh.tahoe-${VERSION}.tar.Z DIFFS.[123]
62922347Spst	-mkdir tcsh.tahoe-${VERSION}
63022347Spst	./MAKEDIFFS tahoe
63122347Spst	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.tahoe-${VERSION}
63222347Spst	cp ${DISTSRCS} tcsh.tahoe-${VERSION}
63322347Spst	-mkdir tcsh.tahoe-${VERSION}/config
63422347Spst	cp ${CONFSRCS} tcsh.tahoe-${VERSION}/config
63522347Spst	cp Makefile tcsh.tahoe-${VERSION}/Makefile.new
63622347Spst	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
63722347Spst	tar cvf - tcsh.tahoe-${VERSION} | compress > tcsh.tahoe-${VERSION}.tar.Z
63822347Spst	rm -rf tcsh.tahoe-${VERSION}
63922347Spst
64022347Spsttcsh.reno-${VERSION}.tar.Z:
64122347Spst	rm -rf tcsh.reno-${VERSION} 
64222347Spst	rm -f tcsh.reno-${VERSION}.tar tcsh.reno-${VERSION}.tar.Z DIFFS.[123]
64322347Spst	-mkdir tcsh.reno-${VERSION}
64422347Spst	./MAKEDIFFS reno
64522347Spst	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.reno-${VERSION}
64622347Spst	cp ${DISTSRCS} tcsh.reno-${VERSION}
64722347Spst	-mkdir tcsh.reno-${VERSION}/config
64822347Spst	cp ${CONFSRCS} tcsh.reno-${VERSION}/config
64922347Spst	cp Makefile tcsh.reno-${VERSION}/Makefile.new
65022347Spst	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
65122347Spst	tar cvf - tcsh.reno-${VERSION} | compress > tcsh.reno-${VERSION}.tar.Z
65222347Spst	rm -rf tcsh.reno-${VERSION}
65322347Spst
65422347Spstftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z
65522347Spst	cp tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z ${FTPAREA}
65622347Spst	cp tcsh.man ${FTPAREA}
65759118Skris
65892906Smarkmautoconfigure: $(srcdir)/configure $(srcdir)/config.h.in
65922347Spst
66022347Spst$(srcdir)/configure: $(srcdir)/configure.in
66122347Spst	cd $(srcdir) && autoconf
66222347Spst
66322347Spst$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
66422347Spst$(srcdir)/stamp-h.in: $(srcdir)/configure.in
66522347Spst	cd $(srcdir) && autoheader
66692906Smarkm	@echo timestamp > $(srcdir)/stamp-h.in
66722347Spst
66822347Spstcheck: atconfig $(srcdir)/tests/testsuite
66922347Spst	$(SHELL) $(srcdir)/tests/testsuite
67022347Spst
67129964Sache#
67229964Sache# Dependencies
67329964Sache#
67422347Spstconfig.h: config_f.h
67522347Spst
67622347SpstTCH=tc.h tc.const.h tc.decls.h tc.nls.h tc.os.h tc.sig.h
67722347SpstSHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
67822347Spst    sh.decls.h ${TCH}
67922347SpstTWH=tw.h tw.decls.h
68022347SpstEDH=ed.h ed.decls.h
68122347Spst
68222347Spst# EDH
68322347SpstEDINC=sh.${SUF} sh.func.${SUF} sh.lex.${SUF} sh.print.${SUF} sh.proc.${SUF} \
68492906Smarkm      sh.set.${SUF} tc.bind.${SUF} tc.os.${SUF} tc.prompt.${SUF} \
68522347Spst      tc.sched.${SUF} tw.parse.${SUF} tw.color.${SUF}
68622347Spst${EDOBJS} ${EDINC} : ${EDH}
68722347Spst
68822347Spst# SHH
68922347Spst${OBJS}: config.h ${SHH}
69022347Spst
69122347Spst# TWH
69222347SpstTWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
69322347Spst      sh.set.${SUF} tc.func.${SUF} tc.nls.${SUF} tw.color.${SUF}
69422347Spst${TWOBJS} ${TWINC}: ${TWH}
69522347Spst
69622347Spst# glob.h
69722347Spstglob.${SUF} sh.glob.${SUF}: glob.h
69822347Spst
69922347Spst# ed.defns.h
70022347SpstEDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
70122347Spst${EDOBJS} ${EDDINC}: ed.defns.h
70222347Spst
70322347Spst# tc.defs.o
70422347Spsttc.defs.${SUF}:	tc.defs.c sh.h
70522347Spst