Makefile revision 69551
150471Speter# $FreeBSD: head/bin/csh/Makefile 69551 2000-12-03 16:28:56Z ache $
21556Srgrimes#	@(#)Makefile	8.1 (Berkeley) 5/31/93
31556Srgrimes#
41556Srgrimes# C Shell with process control; VM/UNIX VAX Makefile
51556Srgrimes# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
61556Srgrimes#
71556Srgrimes# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
81556Srgrimes
959576SobrienTCSHDIR= ${.CURDIR}/../../contrib/tcsh
1059355Sobrien.PATH: ${TCSHDIR}
1159355Sobrien
121556SrgrimesPROG=	csh
1359432SacheSUBDIR= nls
1469551SacheDFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
1559355SobrienCFLAGS+= -I${TCSHDIR} -I${.CURDIR} -I. ${DFLAGS}
1659355SobrienSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
1759355Sobrien	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
1859355Sobrien	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
1969415Sache	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
2059355SobrienSRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
2159355SobrienSRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
2259355Sobrien	tw.comp.c tw.color.c
2359355SobrienSRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
2459355Sobrien	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
2559355SobrienSRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
2659355Sobrien	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
2759355Sobrien	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
2859355Sobrien	tc.who.c tc.h
2969415SacheGENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
3060599SbdeSRCS+=	${GENHDRS}
311556Srgrimes
321864SwollmanMAN1=	csh.1
3360029SjkoshyMLINKS= csh.1 tcsh.1
3451090Ssheldonh# MLINKS for Shell built in commands for which there are no userland
3551090Ssheldonh# utilities of the same name are handled with the associated manpage,
3651090Ssheldonh# builtin.1 in share/man/man1/.
3751090Ssheldonh
3862759SacheDPADD=	${LIBTERMCAP} ${LIBCRYPT}
3962759SacheLDADD=	-ltermcap -lcrypt
401556Srgrimes
4159393SobrienLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
4259393Sobrien
4369415SacheCLEANFILES= ${GENHDRS} gethost csh.1
4460599Sbde
4559355Sobriencsh.1: tcsh.man
4659355Sobrien	ln -sf ${.ALLSRC} ${.TARGET}
471556Srgrimes
4869551Sachebuild-tools: gethost
4969551Sache
5069415Sachegethost: gethost.c sh.err.h tc.const.h sh.h
5169415Sache	@rm -f ${.TARGET}
5269415Sache	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
5369415Sache
5469415Sachetc.defs.c: gethost ${.CURDIR}/host.defs
5569415Sache	@rm -f ${.TARGET}
5669415Sache	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
5769415Sache	./gethost ${.CURDIR}/host.defs >> ${.TARGET}
5869415Sache
5959355Sobriened.defns.h: ed.defns.c
6027965Ssteve	@rm -f ${.TARGET}
6127965Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
6259355Sobrien	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
6359355Sobrien	@echo '#define _h_ed_defns' >> ${.TARGET}
6459355Sobrien	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
6559355Sobrien	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
6659355Sobrien
6759355Sobriensh.err.h: sh.err.c
6859355Sobrien	@rm -f ${.TARGET}
6959355Sobrien	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
7059355Sobrien	@echo '#ifndef _h_sh_err' >> ${.TARGET}
7159355Sobrien	@echo '#define _h_sh_err' >> ${.TARGET}
7269415Sache	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
7359355Sobrien	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
741556Srgrimes
7559355Sobrientc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
7627969Ssteve	@rm -f ${.TARGET}
7727969Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
7859355Sobrien	@echo '#ifndef _h_tc_const' >> ${.TARGET}
7959355Sobrien	@echo '#define _h_tc_const' >> ${.TARGET}
8069415Sache	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
811556Srgrimes	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
8227969Ssteve	    sort >> ${.TARGET}
8359355Sobrien	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
841556Srgrimes
851556Srgrimes.include <bsd.prog.mk>
86