Makefile revision 126173
1145519Sdarrenr# $FreeBSD: head/bin/csh/Makefile 126173 2004-02-23 20:05:14Z johan $
2145510Sdarrenr#	@(#)Makefile	8.1 (Berkeley) 5/31/93
322514Sdarrenr#
453024Sguido# C Shell with process control; VM/UNIX VAX Makefile
522514Sdarrenr# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
680486Sdarrenr#
722514Sdarrenr# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
8145510Sdarrenr
9145510SdarrenrTCSHDIR= ${.CURDIR}/../../contrib/tcsh
10255332Scy.PATH: ${TCSHDIR}
1192686Sdarrenr
12145510SdarrenrPROG=	csh
1322514Sdarrenr.if defined(RESCUE)
1422514SdarrenrDFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
1522514Sdarrenr.else
1622514SdarrenrDFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
1722514Sdarrenr.endif
1822514SdarrenrCFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
1931183SpeterWARNS?=	0
2022514SdarrenrSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
21255332Scy	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
2231183Speter	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
2331183Speter	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
2431183SpeterSRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
2531183SpeterSRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
2631183Speter	tw.comp.c tw.color.c
2722514SdarrenrSRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
28145510Sdarrenr	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
29145510SdarrenrSRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
30145510Sdarrenr	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
31145510Sdarrenr	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
32145510Sdarrenr	tc.who.c tc.h
3324583SdarrenrGENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
3422514SdarrenrSRCS+=	${GENHDRS}
3522514Sdarrenr
3622514SdarrenrMLINKS= csh.1 tcsh.1
3722514Sdarrenr# MLINKS for Shell built in commands for which there are no userland
3822514Sdarrenr# utilities of the same name are handled with the associated manpage,
3922514Sdarrenr# builtin.1 in share/man/man1/.
40255332Scy
41255332ScyDPADD=	${LIBTERMCAP} ${LIBCRYPT}
4222514SdarrenrLDADD=	-ltermcap -lcrypt
4322514Sdarrenr
4422514SdarrenrLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
4522514Sdarrenr
4622514SdarrenrCLEANFILES= ${GENHDRS} gethost csh.1
4722514Sdarrenr
4822514SdarrenrFILESDIR= ${SHAREDIR}/examples/tcsh
4922514SdarrenrFILES= complete.tcsh csh-mode.el
5022514Sdarrenr
5122514SdarrenrCATALOGS=	et:et_EE.ISO8859-15 \
5222514Sdarrenr		finnish:fi_FI.ISO8859-1 \
5322514Sdarrenr		french:fr_FR.ISO8859-1 \
5422514Sdarrenr		german:de_DE.ISO8859-1 \
55255332Scy		greek:el_GR.ISO8859-7 \
56255332Scy		italian:it_IT.ISO8859-1 \
57255332Scy		ja:ja_JP.eucJP \
5822514Sdarrenr		russian:ru_RU.KOI8-R \
5922514Sdarrenr		spanish:es_ES.ISO8859-1 \
6022514Sdarrenr		ukrainian:uk_UA.KOI8-U
6122514Sdarrenr
6222514SdarrenrNLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
6322514SdarrenrNLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
6422514Sdarrenr		fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
6522514Sdarrenr		fr_CH.ISO8859-15 fr_FR.ISO8859-15
6622514SdarrenrNLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
6722514Sdarrenr		de_CH.ISO8859-15 de_DE.ISO8859-15
6822514SdarrenrNLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
6922514SdarrenrNLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
7022514Sdarrenr
7122514SdarrenrNLSNAME= tcsh
72145510Sdarrenr
7331183Speter.for catalog in ${CATALOGS}
74145510SdarrenrNLS+=		${catalog:C/.*://}
7531183SpeterNLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
7622514SdarrenrNLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
7722514Sdarrenr.endfor
7822514Sdarrenr
7922514Sdarrenrcsh.1: tcsh.man
8031183Speter	cat ${.ALLSRC} > ${.TARGET}
8122514Sdarrenr
8222514Sdarrenrbuild-tools: gethost
8322514Sdarrenr
8422514Sdarrenrgethost: gethost.c sh.err.h tc.const.h sh.h
8522514Sdarrenr	@rm -f ${.TARGET}
8622514Sdarrenr	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
8722514Sdarrenr
8822514Sdarrenrtc.defs.c: gethost ${.CURDIR}/host.defs
8922514Sdarrenr	@rm -f ${.TARGET}
90255332Scy	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
91255332Scy	./gethost ${.CURDIR}/host.defs >> ${.TARGET}
92255332Scy
93255332Scyed.defns.h: ed.defns.c
9422514Sdarrenr	@rm -f ${.TARGET}
95145510Sdarrenr	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
96145510Sdarrenr	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
9722514Sdarrenr	@echo '#define _h_ed_defns' >> ${.TARGET}
9822514Sdarrenr	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
9922514Sdarrenr	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
10022514Sdarrenr
10134739Spetersh.err.h: sh.err.c
10222514Sdarrenr	@rm -f ${.TARGET}
10322514Sdarrenr	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
10472003Sdarrenr	@echo '#ifndef _h_sh_err' >> ${.TARGET}
10522514Sdarrenr	@echo '#define _h_sh_err' >> ${.TARGET}
106145510Sdarrenr	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
10772003Sdarrenr	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
10872003Sdarrenr
10972003Sdarrenrtc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
11072003Sdarrenr	@rm -f ${.TARGET}
11172003Sdarrenr	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
11272003Sdarrenr	@echo '#ifndef _h_tc_const' >> ${.TARGET}
11322514Sdarrenr	@echo '#define _h_tc_const' >> ${.TARGET}
11422514Sdarrenr	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
11531183Speter	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
11622514Sdarrenr	    sort >> ${.TARGET}
117145510Sdarrenr	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
11831183Speter
119145510Sdarrenr.include <bsd.prog.mk>
12031183Speter