Makefile.std revision 316957
1316957Sdchagin# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $
259243Sobrien#	Makefile.std	4.3	6/11/83
359243Sobrien#
459243Sobrien# C Shell with process control; VM/UNIX VAX Makefile
559243Sobrien# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
659243Sobrien#
759243Sobrien# With an input editor, command completion, etc. and ported to all sorts of
859243Sobrien# things; Paul Placeway, CIS Dept., Ohio State University
959243Sobrien#
1059243SobrienSHELL=/bin/sh
11100616SmpVERSION=6.12
1259243SobrienBUILD=tcsh
1359243Sobriensrcdir=.
1459243Sobrien
1559243Sobrien################################################################
1659243Sobrien## CFLAGS.  For various -D things, see config.h
1759243Sobrien################################################################
1859243Sobrien#
1959243Sobrien# These are the default suffixes from .c to .o and -c to get there
2059243Sobrien# but to use the global optimizer on the mips boxes, see below
2159243Sobrien#
2259243SobrienSUF=o
2359243SobrienCF=-c
2459243Sobrien
2559243SobrienINCLUDES=-I. -I$(srcdir)
2659243Sobrien
2759243SobrienLFLAGS=$(INCLUDES)
2859243Sobrien#LFLAGS=$(INCLUDES) -Zn10000		# hpux lint
2959243Sobrien
3059243Sobrien
3159243Sobrien#CFLAGS= $(INCLUDES) -g			# debug
3259243Sobrien#CFLAGS= $(INCLUDES) -O			# production
3359243Sobrien#CFLAGS= $(INCLUDES) 			# Broken optimizers....
3459243Sobrien
3559243Sobrien#CFLAGS= -g -pg $(INCLUDES) -DPROF
3659243Sobrien#CFLAGS= -O -pg $(INCLUDES) -DPROF
3759243Sobrien
3859243Sobrien# gcc 1.00-1.37
3959243Sobrien#CFLAGS=-O $(INCLUDES) -finline-functions -fstrength-reduce 
4059243Sobrien
4159243Sobrien# gcc 1.37-1.40
4259243Sobrien#CFLAGS=-O $(INCLUDES) -fcombine-regs -finline-functions -fstrength-reduce 
4359243Sobrien# add -msoft-float for 68881 machines.
4459243Sobrien
4559243Sobrien# gcc 2.0
4659243Sobrien# On the sparc, don't use -O2; it breaks setjmp() and vfork()
4759243Sobrien#CFLAGS=-O $(INCLUDES)
4859243Sobrien
4959243Sobrien# gcc-2.1+
5059243SobrienCFLAGS=-O2 $(INCLUDES)
5159243Sobrien
5259243Sobrien# lucid c on suns
5359243Sobrien#CFLAGS=-O5 $(INCLUDES)
5459243Sobrien
5559243Sobrien# gcc 2.1 on linux
5659243Sobrien#CFLAGS=-O6 -fomit-frame-pointer $(INCLUDES)
5759243Sobrien
5859243Sobrien# HP/UX 8.0, 9.0
5959243Sobrien#CFLAGS= $(INCLUDES) +O3 -Aa
6059243Sobrien
6159243Sobrien# Ultrix 4.2a
6259243Sobrien#CFLAGS= $(INCLUDES) -O -Olimit 2000
6359243Sobrien
6459243Sobrien# Intel Paragon OSF/1 with PGI compilers
6559243Sobrien#CFLAGS=-O -Mnodebug -Mnoperfmon $(INCLUDES)
6659243Sobrien
6759243Sobrien# DEC Alpha OSF/1
6859243Sobrien#CFLAGS= -O2 $(INCLUDES) -Olimit 2000	## Normal Optimization
6959243Sobrien#CFLAGS= -O3 $(INCLUDES) -Olimit 2000	## Full Optimization - may not work
7059243Sobrien#CF=-j
7159243Sobrien#SUF=u
7259243Sobrien#.SUFFIXES: .u
7359243Sobrien
7459243Sobrien# for silicon graphics (and other mips compilers) -- use the
7559243Sobrien# global optimizer! (-O3).
7659243Sobrien# On SGI 4.0+ you need to add -D__STDC__ too.
7759243Sobrien#CFLAGS= -O3 $(INCLUDES) 
7859243Sobrien#CFLAGS= -O3 $(INCLUDES) -Olimit 2000	## Ultrix 4.2a
7959243Sobrien#CF=-j
8059243Sobrien#SUF=u
8159243Sobrien#.SUFFIXES: .u 				## Ultrix and gnu-make need that
8259243Sobrien
8359243Sobrien# mips systems
8459243Sobrien# CFLAGS= $(INCLUDES) -O -systype bsd43 -Wf,-XNd5000 -Wf,-XNp6000 -Olimit 2000
8559243Sobrien
8659243Sobrien# for at&t machines
8759243Sobrien#CFLAGS= -O -Ksd $(INCLUDES)
8859243Sobrien
8959243Sobrien# Stardent Titan
9059243Sobrien#CFLAGS = $(INCLUDES) -O -43
9159243Sobrien
9259243Sobrien# Stardent Stellar or sunos4 /bin/cc or Solaris2.1 /opt/SUNWspro/bin/cc
9359243Sobrien#CFLAGS = $(INCLUDES) -O4
9459243Sobrien
9559243Sobrien# Intergraph clipper CLIX 3.1
9659243Sobrien#CFLAGS= -w -O2 $(INCLUDES)
9759243Sobrien
9859243Sobrien# Dnix 5.3
9959243Sobrien#CFLAGS = -O -X7
10059243Sobrien
10159243Sobrien# Pyramid OS/x
10259243Sobrien#CFLAGS = -OG
10359243Sobrien
10459243Sobrien# Multiflow (5M binary... if you choose -O5!)
10559243Sobrien#CFLAGS = -O5 -sb_trace 0
10659243Sobrien
10759243Sobrien# DDE Supermax Unix SYSV Rel III.
10859243Sobrien# CFLAGS= -O3
10959243Sobrien
11059243Sobrien# SINIX RMx00
11159243Sobrien#CFLAGS= -O # -D_POSIX_SOURCE # -kansi
11259243Sobrien
11369408Sache# Minix-VMD
11469408Sache# CFLAGS= -O -D_ANSI_H -I /usr/include/bsdcompat $(INCLUDES)
11569408Sache
11659243Sobrien# Apollo's with cc [apollo builtins don't work with gcc]
11759243Sobrien# and apollo should not define __STDC__ if it does not have
11859243Sobrien# the standard header files. RT's (aos4.3) need that too;
11959243Sobrien# you might want to skip the -O on the rt's... Not very wise.
12059243Sobrien# AIX/ESA needs -D_IBMESA on command line (this may disappear by GA)
12159243Sobrien#DFLAGS=-U__STDC__ 
12259243Sobrien#DFLAGS=-D_IBMESA
12359243Sobrien# On aix2.2.1 we need more compiler space.
12459243Sobrien#DFLAGS=-Nd4000 -Nn3000
12559243Sobrien# AU/X 2.0 needs a flag for POSIX (read the config file)
12659243Sobrien#DFLAGS=-Zp
12759243Sobrien# Tektronix 4300 running UTek 4.0 (BSD 4.2) needs:
12859243Sobrien#DFLAGS = -DUTek -DBSD
12959243Sobrien# VMS_POSIX needs:
13059243Sobrien#DFLAGS=-D_VMS_POSIX
13159243Sobrien# Multiflow and PCC compilers don't like void typedefs.
13259243Sobrien# You may also need -U__STDC__ if you use pcc (i.e. ibmrt aos4.3).
13359243Sobrien#DFLAGS=-DMULTIFLOW
13459243Sobrien#DFLAGS=-DPCC
13559243Sobrien# DELL SVR4
13659243Sobrien#DFLAGS=-DDELL
13759243Sobrien# SCO_SV
13859243Sobrien#DFLAGS=-D_SPEED_T -DSCO
13959243SobrienDFLAGS=
14059243Sobrien#DFLAGS=-D_PATH_TCSHELL='"${DESTBIN}/tcsh"'
14159243Sobrien
14259243Sobrien
14359243Sobrien################################################################
14459243Sobrien## LDFLAGS.  Define something here if you need to
14559243Sobrien################################################################
14659243SobrienLDFLAGS= 			## The simplest, suitable for all.
14759243Sobrien#LDFLAGS= -s			## Stripped. Takes less space on disk.
14859243Sobrien#LDFLAGS= -s -n			## Pure executable. Spares paging over
14959243Sobrien# 				## the network for machines with local
15059243Sobrien#				## swap but external /usr/local/bin .
15159243Sobrien#LDFLAGS= -s -n -Bstatic	## Without dynamic linking. (SunOS/cc)
15259243Sobrien#LDFLAGS= -s -n -static		## Without dynamic linking. (SunOS/gcc)
15359243Sobrien#LDFLAGS= -Wl,-s,-n		## Stripped, shared text (Unicos)
15459243Sobrien#LDFLAGS= -s -static		## Link statically. (linux)
15559243Sobrien#LDFLAGS= -s -N			## Impure executable (linux)
15659243Sobrien#LDFLAGS= -Bdynamic -dy		## SCO_SV
15759243Sobrien
15859243Sobrien################################################################
15959243Sobrien## LIBES.  Pick one, or roll your own.
16059243Sobrien################################################################
16159243SobrienLIBES= -ltermcap 			 ## BSD style things
16259243Sobrien#LIBES= -ltermcap			 ## SunOS, HP-UX, pyramid
16359243Sobrien#LIBES= -ltermcap			 ## Linux
16459243Sobrien#LIBES= -ltermcap -lshadow		 ## Linux with PW_SHADOW
16559243Sobrien#LIBES= -ltermcap -lsec			 ## Tek XD88/10 (UTekV) with PW_SHADOW
16659243Sobrien#LIBES= -ltermcap -lsec			 ## Motorola MPC (sysV88) with PW_SHADOW
16759243Sobrien#LIBES= -ltermcap -lcs			 ## Mach
16859243Sobrien#LIBES= -ltermcap -lbsd			 ## DEC osf1 on the alpha
16959243Sobrien#LIBES= -ltermcap -lbsd			 ## Intel paragon
17059243Sobrien#LIBES= -ltermcap -lbsd			 ## Clipper intergraph
17159243Sobrien#LIBES= -ltermcap -lseq			 ## Sequent's Dynix
17259243Sobrien#LIBES= -ltermcap -lauth		 ## Ultrix with Enhanced Security
17359243Sobrien#LIBES= -ltermcap -ldir -lx		 ## Xenix 386 style things
17459243Sobrien#LIBES= -ltermcap -lndir -lsocket -ljobs ## masscomp RTU6.0
17559243Sobrien#LIBES= -lcurses			 ## AIX on the rt
17659243Sobrien#LIBES= -lcurses			 ## TitanOS on the stellar
17759243Sobrien#LIBES= -ltermlib -lsocket -lnsl	 ## SysV4 w/o BSDTIMES or Solaris 2
17859243Sobrien#LIBES= -lcurses			 ## SysV3 w/o networking
17959243Sobrien#LIBES= -lcurses -lnet			 ## SysV3 with networking
18059243Sobrien#LIBES= -lcurses -ldir			 ## SysV2 w/o networking & dirlib
18159243Sobrien#LIBES= -lcurses -ldir -lnet		 ## SysV2 with networking & dirlib
18259243Sobrien#LIBES= -lcurses -lbsd			 ## AIX on the IBM 370 or rs6000 or ps2
18359243Sobrien#LIBES= -lcurses -lbsd			 ## ETA10
18459243Sobrien#LIBES= -lcurses -lbsd			 ## Irix3.1 on the SGI-IRIS4D
18559243Sobrien#LIBES= -lcurses -lbsd -lc_s		 ## Irix3.3 on the SGI-IRIS4D w/o yp
18659243Sobrien#LIBES= -lcurses -lsun -lbsd -lc_s	 ## Irix3.3 on the SGI-IRIS4D with yp
18759243Sobrien#LIBES= -lcurses -lsocket -lbsd		 ## Amdahl UTS 2.1
18859243Sobrien#LIBES= -lcurses -lsocket		 ## Intel's hypercube.
18959243Sobrien#LIBES= -lcurses -lsocket		 ## ns32000 based Opus.
19059243Sobrien#LIBES= -lcurses -lcposix		 ## ISC 2.2 without networking
19159243Sobrien#LIBES= -lcposix -lc_s -lcurses -linet	 ## ISC 2.2 with networking
19259243Sobrien#LIBES= -lcurses -lsec -lc_s		 ## ISC 2.0.2 without networking
19359243Sobrien#LIBES= -lcurses -linet -lsec -lc_s	 ## ISC 2.0.2 with networking
19459243Sobrien#LIBES= -lcurses -lintl -lcrypt		 ## SCO SysVR3.2v2.0
19559243Sobrien#LIBES= -lcurses -lintl -lsocket -lcrypt ## SCO+ODT1.1
19659243Sobrien#LIBES= -lcurses -lsocket -lcrypt	 ## SCO_SV
19759243Sobrien#LIBES= -lposix -ltermcap		 ## A/UX 2.0
19859243Sobrien#LIBES= -lposix -ltermcap -lc_s		 ## A/UX 3.0
19959243Sobrien#LIBES= -ldirent -lcurses		 ## att3b1 cc w/o shared lib & dirlib
20059243Sobrien#LIBES= -shlib -ldirent -lcurses	 ## att3b1 gcc with shared lib & dirlib
20159243Sobrien#LIBES= -ltermlib -lsocket -lnsl -lc /usr/ucblib/libucb.a ## SysV4 with BSDTIMES
20259243Sobrien#LIBES= -lcurses -lnsl -lsocket -lc /usr/ucblib/libucb.a ## Stardent Vistra
20359243Sobrien#LIBES= -ltermc				 ## emx under OS/2
20459243Sobrien#LIBES=					 ## Minix, VMS_POSIX
20559243Sobrien#LIBES= -ltermcap -lcrypt		 ## Multiflow
20659243Sobrien#LIBES= -ltermcap -lcrypt		 ## NetBSD
20759243Sobrien#LIBES= -lcurses 			 ## DDE Supermax
20859243Sobrien
20959243Sobrien################################################################
21059243Sobrien## EXTRAFLAGS and EXTRALIBS
21159243Sobrien################################################################
21259243Sobrien# Compiling for HESIOD
21359243Sobrien#HESDEF = -DHESIOD -I/usr/athena/include
21459243Sobrien#HESLIB = -L/usr/athena/lib -lhesiod
21559243Sobrien#
21659243Sobrien# Compiling for AFS with kerberos authentication
21759243Sobrien#AFSLIBDIR = /usr/afsws/lib
21859243Sobrien#AFSDEF = -DAFS -I/usr/afsws/include
21959243Sobrien#AFS33LIB = -laudit
22059243Sobrien#
22159243Sobrien#Solaris and HPUX require the BSD libraries with AFS.
22259243Sobrien#We use -lc to use only what we require.
22359243Sobrien#AFSAUXLIB = -lsocket -lnsl -lc -lucb                    # Solaris
22459243Sobrien#AFSAUXLIB = -lc -lBSD                                   # HPUX   
22559243Sobrien#
22659243Sobrien#AFSLIB = -L$(AFSLIBDIR) -L$(AFSLIBDIR)/afs -lkauth -lprot -lubik\
22759243Sobrien#         -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err\
22859243Sobrien#         $(AFSLIBDIR)/afs/util.a $(AFS33LIB) $(AFSAUXLIB)
22959243Sobrien#
23059243Sobrien
23159243SobrienEXTRAFLAGS = $(HESDEF) $(AFSDEF)
23259243SobrienEXTRALIBS = $(HESLIB) $(AFSLIB)
23359243Sobrien
23459243Sobrien
23559243Sobrien# The difficult choice of a c-compiler...
23659243Sobrien# First, you should try your own c-compiler. 
23759243Sobrien# Gcc -traditional is also a safe choice. 
23859243Sobrien# If you think that you have good include files try gcc -Wall...
23959243Sobrien# If you want to take out -traditional, make sure that your sys/ioctl.h
24059243Sobrien# is fixed correctly, otherwise you'll be stopped for tty input, or you
24159243Sobrien# will lose the editor and job control.
24259243Sobrien
24359243Sobrien# This is for setting your C preprocessor value.
24459243SobrienCPP = ${CC} -E
24559243Sobrien# The -B tells gcc to use /bin/ld. This is to avoid using the gnu ld, which
24659243Sobrien# on the suns does not know how to make dynamically linked binaries.
24759243SobrienCC=	gcc -Wall -pipe -B/bin/	# -ansi -pedantic
24859243Sobrien#CC=	gcc -m486 -pipe -Wall # Generate code for Intel 486 (linux)
24959243Sobrien#CC=	shlicc 	# BSDI2.1 w/ shared libraries
25059243Sobrien#CC=	cc
25159243Sobrien#CC=	occ
25259243Sobrien#CC=	acc
25359243Sobrien#CC=	pcc
25459243Sobrien#CC=	hc -w
25559243Sobrien#CC=	c89	# For VMS/POSIX
25659243Sobrien#CC=	/bin/cc	# For suns, w/o gcc and SVR4
25759243Sobrien#CC=	/usr/lib/sun.compile/cc  # FPS 500 (+FPX) with Sun C compiler
25859243Sobrien#CC=	/opt/SUNWspro/bin/cc	# Solaris 2.1
25959243Sobrien#CC=	scc 	# Alliant fx2800
26059243Sobrien#CC=	lcc	-wa 
26159243Sobrien#CC=	cc -b elf -Kpic # SCO_SV
26259243SobrienED=	ed
26359243SobrienAS=	as
26459243SobrienRM=	rm
26559243SobrienCXREF=	/usr/ucb/cxref
26659243Sobrien#CXREF=	/bin/cxref			# SCO_SV
26759243SobrienVGRIND=	csh /usr/ucb/vgrind
26859243SobrienCTAGS=	/usr/ucb/ctags
26959243Sobrien#CTAGS=	/usr/bin/ctags			# SCO_SV
27059243Sobrien#XSTR= /usr/ucb/xstr
27159243Sobrien#XSTR= /usr/bin/xstr			# SCO_SV
27259243SobrienSCCS=	/usr/local/sccs
27359243SobrienPARALLEL=12				# Make the multi-max run fast.
27459243Sobrien#P=&					# Use Sequent's parallel make
27559243SobrienP=
27659243SobrienDESTDIR=/usr/local
27759243Sobrien#DESTDIR=/usr/contrib
27859243SobrienMANSECT=1
27959243SobrienDESTBIN=${DESTDIR}/bin
28059243SobrienDESTMAN=${DESTDIR}/man/man${MANSECT}
28159243Sobrien# DESTMAN=${DESTDIR}/catman/man${MANSECT}	 # A/UX
28259243Sobrien# DESTMAN=${DESTDIR}/usr/share/man/man${MANSECT} # Stardent Vistra (SysVR4)
28359243Sobrien# DESTMAN=/usr/catman/1l			 # Amiga unix (SysVR4)
28459243SobrienFTPAREA=/usr/spool/ftp
28559243Sobrien
28659243SobrienASSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
28759243Sobrien	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
28859243Sobrien	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
28959243Sobrien	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h 
290316957SdchaginPSSRCS= sh.decls.h glob.c glob.h dotlock.c dotlock.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
29159243Sobrien	vms.termcap.c
29259243SobrienSHSRCS= ${ASSRCS} ${PSSRCS}
29359243SobrienSHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
294100616Smp	sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
295100616Smp	sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
296100616Smp	sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
297316957Sdchagin	sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} dotlock.${SUF} \
298100616Smp	mi.termios.${SUF} ma.setp.${SUF} vms.termcap.${SUF}
29959243Sobrien
30059243SobrienTWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
30159243Sobrien	tw.comp.c tw.color.c
30259243SobrienTWOBJS=	tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
30359243Sobrien	tw.comp.${SUF} tw.color.${SUF}
30459243Sobrien
30559243SobrienEDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
30659243Sobrien	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
30759243SobrienEDOBJS=	ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
30859243Sobrien	ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
30959243Sobrien
31059243SobrienTCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
311145479Smp	tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
31259243Sobrien	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
31359243Sobrien	tc.who.c tc.h
31459243SobrienTCOBJS=	tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
315145479Smp	tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} tc.printf.${SUF} \
31659243Sobrien	tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
31759243Sobrien	tc.vers.${SUF} tc.who.${SUF} 
31859243Sobrien
31959243SobrienPVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32
32059243SobrienAVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
32159243Sobrien	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
32259243Sobrien	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
32359243Sobrien	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
324316957Sdchagin	host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \
325316957Sdchagin	aclocal.m4
32659243Sobrien
32759243SobrienVHSRCS=${PVSRCS} ${AVSRCS}
32859243Sobrien
32959243SobrienCONFSRCS=config/* 
33059243Sobrien
33159243SobrienALLSRCS=  ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS}
33259243SobrienDISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS}
33359243Sobrien
33459243Sobrien
33559243SobrienOBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS}
33659243Sobrien
33759243Sobrien
33859243Sobrienall: ${BUILD}
33959243Sobrien
34059243Sobrientcsh:$(P) ${OBJS} 
34159243Sobrien	rm -f tcsh core
34259243Sobrien	${CC} -o tcsh ${LDFLAGS} ${CFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
34359243Sobrien
34459243Sobrien# Purify
34559243Sobrienpure:$(P) ${OBJS} 
34659243Sobrien	rm -f tcsh core
34759243Sobrien	purify `echo ${CC} | sed -e s,-B/bin/,,` -o tcsh ${LDFLAGS} ${CFLAGS} ${OBJS} ${LIBES} ${EXTRALIBS}
34859243Sobrien# OS/2
34959243Sobrientcsh.exe: tcsh
35059243Sobrien	emxbind tcsh
35159243Sobrien
35259243Sobriengethost:  gethost.c sh.err.h tc.const.h sh.h
35359243Sobrien	rm -f gethost
35459243Sobrien	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${DFLAGS} $(srcdir)/gethost.c ${LIBES} ${EXTRALIBS}
35559243Sobrien
35659243Sobrientc.defs.c:	gethost host.defs
35759243Sobrien	@rm -f $@
35859243Sobrien	@echo "/* Do not edit this file, make creates it */" > $@
35959243Sobrien	./gethost $(srcdir)/host.defs >> $@
36059243Sobrien
36159243Sobrientcsh.ps: tcsh.man
36259243Sobrien	rm -f tcsh.ps
36359243Sobrien	-ptroff -t -man $(srcdir)/tcsh.man > tcsh.ps
36459243Sobrien
36559243Sobrien
36659243Sobrien.c.${SUF}:
36759243Sobrien	${CC} ${CF} ${CFLAGS} ${DFLAGS} ${EXTRAFLAGS} $<
36859243Sobrien
36959243Sobrien# _VMS_POSIX #module addition
37059243Sobrien#.c.${SUF}:
37159243Sobrien#	@(echo '#module '`echo $< | sed -e 's/\./_/g'`; cat $<) > $*..c
37259243Sobrien#	@echo ${CC} ${CF} ${CFLAGS} ${DFLAGS} ${EXTRAFLAGS} $*.c
37359243Sobrien#	@${CC} ${CF} ${CFLAGS} ${DFLAGS} ${EXTRAFLAGS} $*..c
37459243Sobrien#	@mv $*..o $*.o
37559243Sobrien#	@rm -f $*..c
37659243Sobrien
37759243Sobrien
37859243Sobrien# Don't do any special massaging of C files for sharing of strings!!
37959243Sobrien# it causes weird segmentation faults on some systems.
38059243Sobrien#.c.o:
38159243Sobrien#	${CPP} ${CFLAGS} $*.c | ${XSTR} -c -
38259243Sobrien#	${CC} ${CF} ${CFLAGS} x.c 
38359243Sobrien#	mv -f x.o $*.o
38459243Sobrien#	rm -f x.c
38559243Sobrien
38659243Sobrien#ed.init.o: ed.init.c
38759243Sobrien#	${CPP} ${CFLAGS} $*.c | ${XSTR} -c -
38859243Sobrien#	${CC} -R ${CF} ${CF} x.c 
38959243Sobrien#	mv -f x.o $*.o
39059243Sobrien#	rm -f x.c
39159243Sobrien
39259243Sobrien#strings.o: strings
39359243Sobrien#	${XSTR}
39459243Sobrien#	${CC} -c -R xs.c
39559243Sobrien#	mv -f xs.o strings.o
39659243Sobrien#	rm -f xs.c
39759243Sobrien
39859243Sobrien##.DEFAULT:
39959243Sobrien##	${SCCS} get $<
40059243Sobrien
40159243Sobrien##.DEFAULT:
40259243Sobrien##	co $<
40359243Sobrien
40459243Sobriened.defns.h: ed.defns.c
40559243Sobrien	@rm -f $@
40659243Sobrien	@echo '/* Do not edit this file, make creates it. */' > $@
40759243Sobrien	@echo '#ifndef _h_ed_defns' >> $@
40859243Sobrien	@echo '#define _h_ed_defns' >> $@
40959243Sobrien	grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@
41059243Sobrien	@echo '#endif /* _h_ed_defns */' >> $@
41159243Sobrien
41259243Sobriensh.err.h: sh.err.c
41359243Sobrien	@rm -f $@
41459243Sobrien	@echo '/* Do not edit this file, make creates it. */' > $@
41559243Sobrien	@echo '#ifndef _h_sh_err' >> $@
41659243Sobrien	@echo '#define _h_sh_err' >> $@
41759243Sobrien	grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@
41859243Sobrien	@echo '#endif /* _h_sh_err */' >> $@
41959243Sobrien
42059243Sobrientc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
42159243Sobrien	@rm -f $@
42259243Sobrien	@echo '/* Do not edit this file, make creates it. */' > $@
42359243Sobrien	@echo '#ifndef _h_tc_const' >> $@
42459243Sobrien	@echo '#define _h_tc_const' >> $@
42559243Sobrien	${CPP} $(INCLUDES) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
42659243Sobrien	    $(srcdir)/tc.const.c | grep 'Char STR' | \
427100616Smp	    sed -e 's/Char \([a-zA-Z0-9_]*\) *\[ *\].*/extern Char \1[];/' | \
428316957Sdchagin	    LC_COLLATE=C sort >> $@
42959243Sobrien	@echo '#endif /* _h_tc_const */' >> $@
43059243Sobrien
43159243Sobriencsh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
43259243Sobrien	rm -f csh.prof
43359243Sobrien	ld -X mcrt0.${SUF} ${OBJS} -o csh.prof ${LIBES} -lc
43459243Sobrien
43559243Sobriensh.prof.${SUF}:
43659243Sobrien	cp sh.c sh.prof.c
43759243Sobrien	${CC} ${CF} ${CFLAGS} -DPROF sh.prof.c
43859243Sobrien
43959243Sobrienlint: tc.const.h ed.defns.h
44059243Sobrien	lint ${DFLAGS} ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES}
44159243Sobrien
44259243Sobrienalint: tc.const.h ed.defns.h
44359243Sobrien	alint ${DFLAGS} ${LFLAGS} sh*.c tw*.c ed*.c tc.*.c ${LIBES}
44459243Sobrien
44559243Sobrienprint:
44659243Sobrien	@pr READ_ME
44759243Sobrien	@pr makefile makefile.*
44859243Sobrien	@(size -l a.out; size *.${SUF}) | pr -h SIZES
44959243Sobrien	@${CXREF} sh*.c | pr -h XREF
45059243Sobrien	@ls -l | pr 
45159243Sobrien	@pr sh*.h [a-rt-z]*.h sh*.c alloc.c
45259243Sobrien
45359243Sobrienvprint:
45459243Sobrien	@pr -l84 READ_ME TODO
45559243Sobrien	@pr -l84 makefile makefile.*
45659243Sobrien	@(size -l a.out; size *.${SUF}) | pr -l84 -h SIZES
45759243Sobrien	@${CXREF} sh*.c | pr -l84 -h XREF
45859243Sobrien	@ls -l | pr -l84
45959243Sobrien	@${CXREF} sh*.c | pr -l84 -h XREF
46059243Sobrien	@pr -l84 sh*.h [a-rt-z]*.h sh*.c alloc.c
46159243Sobrien
46259243Sobrienvgrind:
46359243Sobrien	@cp /dev/null index
46459243Sobrien	@for i in *.h; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
46559243Sobrien	@for i in *.c; do vgrind -t -h "C Shell" $$i >/crp/bill/csh/$$i.t; done
46659243Sobrien	@vgrind -t -x -h Index index >/crp/bill/csh/index.t
46759243Sobrien
46859243Sobrieninstall: tcsh 
46959243Sobrien	-mv -f ${DESTBIN}/tcsh  ${DESTBIN}/tcsh.old
47059243Sobrien	cp tcsh ${DESTBIN}/tcsh
47159243Sobrien	-strip ${DESTBIN}/tcsh
47259243Sobrien	chmod 555 ${DESTBIN}/tcsh
47359243Sobrien
47459243Sobrieninstall.man: tcsh.man
47559243Sobrien	-rm -f ${DESTMAN}/tcsh.${MANSECT}
47659243Sobrien	cp $(srcdir)/tcsh.man ${DESTMAN}/tcsh.${MANSECT}
47759243Sobrien	chmod 444 ${DESTMAN}/tcsh.${MANSECT}
47859243Sobrien
47959243Sobrien# Amiga Unix
48059243Sobrien#install.man: tcsh.man
48159243Sobrien#        compress tcsh.man
48259243Sobrien#	cp tcsh.man.Z ${DESTMAN}/tcsh.Z
48359243Sobrien#	chmod 444 ${DESTMAN}/tcsh.Z
48459243Sobrien
48559243Sobrien# Apple A/UX
48659243Sobrien#install.man: tcsh.man
48759243Sobrien#	-rm -f ${DESTMAN}/tcsh.${MANSECT}.Z
48859243Sobrien#	nroff -man tcsh.man | compress > ${DESTMAN}/tcsh.${MANSECT}.Z
48959243Sobrien#	chmod 444 ${DESTMAN}/tcsh.${MANSECT}.Z
49059243Sobrien
49159243Sobrienclean:
49259243Sobrien	${RM} -f a.out strings x.c xs.c tcsh tcsh.a _MAKE_LOG core gethost
49359243Sobrien	${RM} -f *.${SUF} sh.prof.c ed.defns.h tc.const.h sh.err.h tc.defs.c
49459243Sobrien	${RM} -f tcsh.*.m tcsh.*.cat
49559243Sobrien
49659243Sobrienveryclean: clean
49759243Sobrien	${RM} -f config.h config.status config.cache config.log Makefile tcsh.ps
49859243Sobrien	${RM} -f *~ #*
49959243Sobrien
50059243Sobriendistclean: veryclean
50159243Sobrien
50259243Sobrientags:	/tmp
50359243Sobrien	${CTAGS} sh*.c
50459243Sobrien
50559243Sobrientar.Z:
50659243Sobrien	rm -f tcsh-${VERSION}.tar.Z
50759243Sobrien	rm -rf tcsh-${VERSION} 
50859243Sobrien	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
50959243Sobrien	cp ${ALLSRCS} tcsh-${VERSION}
51059243Sobrien	cp ${CONFSRCS} tcsh-${VERSION}/config
51159243Sobrien	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
51259243Sobrien	tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
51359243Sobrien	rm -rf tcsh-${VERSION}
51459243Sobrien
51559243Sobrientar.gz:
51659243Sobrien	rm -f tcsh-${VERSION}.tar.gz
51759243Sobrien	rm -rf tcsh-${VERSION} 
51859243Sobrien	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
51959243Sobrien	cp ${ALLSRCS} tcsh-${VERSION}
52059243Sobrien	cp ${CONFSRCS} tcsh-${VERSION}/config
52159243Sobrien	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
52259243Sobrien	tar cvf - tcsh-${VERSION} | gzip > tcsh-${VERSION}.tar.gz
52359243Sobrien	rm -rf tcsh-${VERSION}
52459243Sobrien
52559243Sobrienshar:
52659243Sobrien	rm -f tcsh-*.shar
52759243Sobrien	rm -rf tcsh-${VERSION} 
52859243Sobrien	mkdir tcsh-${VERSION} tcsh-${VERSION}/config
52959243Sobrien	cp ${ALLSRCS} tcsh-${VERSION}
53059243Sobrien	cp ${CONFSRCS} tcsh-${VERSION}/config
53159243Sobrien	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
53259243Sobrien	MAKESHAR -v -n tcsh-${VERSION} tcsh-${VERSION} \
53359243Sobrien		 tcsh-${VERSION}/?* tcsh-${VERSION}/config/?* \
53459243Sobrien		 tcsh-${VERSION}/?*/set?*
53559243Sobrien	rm -rf tcsh-${VERSION}
53659243Sobrien
53759243Sobriencatalogs:
53859243Sobrien	@(cd nls; make catalogs)
53959243Sobrien
54059243Sobrientcsh-${VERSION}.tar.Z:
54159243Sobrien	rm -rf tcsh-${VERSION} 
54259243Sobrien	rm -f tcsh-${VERSION}.tar tcsh-${VERSION}.tar.Z DIFFS.[123]
54359243Sobrien	mkdir tcsh-${VERSION}
54459243Sobrien	./MAKEDIFFS bsd
54559243Sobrien	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh-${VERSION}
54659243Sobrien	cp ${DISTSRCS} tcsh-${VERSION}
54759243Sobrien	mkdir tcsh-${VERSION}/config
54859243Sobrien	cp ${CONFSRCS} tcsh-${VERSION}/config
54959243Sobrien	cp Makefile tcsh-${VERSION}/Makefile.new
55059243Sobrien	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
55159243Sobrien	tar cvf - tcsh-${VERSION} | compress > tcsh-${VERSION}.tar.Z
55259243Sobrien	rm -rf tcsh-${VERSION}
55359243Sobrien
55459243Sobrientcsh.tahoe-${VERSION}.tar.Z:
55559243Sobrien	rm -rf tcsh.tahoe-${VERSION} 
55659243Sobrien	rm -f tcsh.tahoe-${VERSION}.tar tcsh.tahoe-${VERSION}.tar.Z DIFFS.[123]
55759243Sobrien	mkdir tcsh.tahoe-${VERSION}
55859243Sobrien	./MAKEDIFFS tahoe
55959243Sobrien	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.tahoe-${VERSION}
56059243Sobrien	cp ${DISTSRCS} tcsh.tahoe-${VERSION}
56159243Sobrien	mkdir tcsh.tahoe-${VERSION}/config
56259243Sobrien	cp ${CONFSRCS} tcsh.tahoe-${VERSION}/config
56359243Sobrien	cp Makefile tcsh.tahoe-${VERSION}/Makefile.new
56459243Sobrien	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
56559243Sobrien	tar cvf - tcsh.tahoe-${VERSION} | compress > tcsh.tahoe-${VERSION}.tar.Z
56659243Sobrien	rm -rf tcsh.tahoe-${VERSION}
56759243Sobrien
56859243Sobrientcsh.reno-${VERSION}.tar.Z:
56959243Sobrien	rm -rf tcsh.reno-${VERSION} 
57059243Sobrien	rm -f tcsh.reno-${VERSION}.tar tcsh.reno-${VERSION}.tar.Z DIFFS.[123]
57159243Sobrien	mkdir tcsh.reno-${VERSION}
57259243Sobrien	./MAKEDIFFS reno
57359243Sobrien	mv DIFFS.1 DIFFS.2 DIFFS.3 tcsh.reno-${VERSION}
57459243Sobrien	cp ${DISTSRCS} tcsh.reno-${VERSION}
57559243Sobrien	mkdir tcsh.reno-${VERSION}/config
57659243Sobrien	cp ${CONFSRCS} tcsh.reno-${VERSION}/config
57759243Sobrien	cp Makefile tcsh.reno-${VERSION}/Makefile.new
57859243Sobrien	tar cf - nls/Makefile nls/?*/set?* | (cd tcsh-${VERSION}; tar xpf -)
57959243Sobrien	tar cvf - tcsh.reno-${VERSION} | compress > tcsh.reno-${VERSION}.tar.Z
58059243Sobrien	rm -rf tcsh.reno-${VERSION}
58159243Sobrien
58259243Sobrienftp: tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z
58359243Sobrien	cp tcsh-${VERSION}.tar.Z tcsh.tahoe-${VERSION}.tar.Z ${FTPAREA}
58459243Sobrien	cp tcsh.man ${FTPAREA}
58559243Sobrien
58659243Sobrienautoconfigure: $(srcdir)/configure $(srcdir)/config.h.in
58759243Sobrien
588316957Sdchagin$(srcdir)/configure: $(srcdir)/configure.ac
58959243Sobrien	cd $(srcdir) && autoconf
59059243Sobrien
59159243Sobrien$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
592316957Sdchagin$(srcdir)/stamp-h.in: $(srcdir)/configure.ac
59359243Sobrien	cd $(srcdir) && autoheader
59459243Sobrien	@echo timestamp > $(srcdir)/stamp-h.in
59559243Sobrien
59659243Sobrien#
59759243Sobrien# Dependencies
59859243Sobrien#
59959243Sobrienconfig.h: config_f.h
60059243Sobrien
601145479SmpTCH=tc.h tc.const.h tc.decls.h tc.nls.h tc.os.h tc.sig.h
60259243SobrienSHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
60359243Sobrien    sh.decls.h ${TCH}
60459243SobrienTWH=tw.h tw.decls.h
60559243SobrienEDH=ed.h ed.decls.h
60659243Sobrien
60759243Sobrien# EDH
60859243SobrienEDINC=sh.${SUF} sh.func.${SUF} sh.lex.${SUF} sh.print.${SUF} sh.proc.${SUF} \
60959243Sobrien      sh.set.${SUF} tc.bind.${SUF} tc.os.${SUF} tc.prompt.${SUF} \
61059243Sobrien      tc.sched.${SUF} tw.parse.${SUF} tw.color.${SUF}
61159243Sobrien${EDOBJS} ${EDINC} : ${EDH}
61259243Sobrien
61359243Sobrien# SHH
61459243Sobrien${OBJS}: config.h ${SHH}
61559243Sobrien
61659243Sobrien# TWH
61759243SobrienTWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
618145479Smp      sh.set.${SUF} tc.func.${SUF} tc.nls.${SUF} tw.color.${SUF}
61959243Sobrien${TWOBJS} ${TWINC}: ${TWH}
62059243Sobrien
62159243Sobrien# glob.h
62259243Sobrienglob.${SUF} sh.glob.${SUF}: glob.h
62359243Sobrien
624316957Sdchagin# dotlock.h
625316957Sdchagindotlock.${SUF}: dotlock.h
626316957Sdchagin
62759243Sobrien# ed.defns.h
62859243SobrienEDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
62959243Sobrien${EDOBJS} ${EDDINC}: ed.defns.h
63059243Sobrien
63159243Sobrien# tc.defs.o
63259243Sobrientc.defs.${SUF}:	tc.defs.c sh.h
633