Makefile revision 116282
150471Speter# $FreeBSD: head/bin/csh/Makefile 116282 2003-06-13 07:04:02Z markm $
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
1369551SacheDFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
1469640SobrienCFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
15116282SmarkmWARNS=	2
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
3260029SjkoshyMLINKS= csh.1 tcsh.1
3351090Ssheldonh# MLINKS for Shell built in commands for which there are no userland
3451090Ssheldonh# utilities of the same name are handled with the associated manpage,
3551090Ssheldonh# builtin.1 in share/man/man1/.
3651090Ssheldonh
3762759SacheDPADD=	${LIBTERMCAP} ${LIBCRYPT}
3862759SacheLDADD=	-ltermcap -lcrypt
391556Srgrimes
4059393SobrienLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
4159393Sobrien
4269415SacheCLEANFILES= ${GENHDRS} gethost csh.1
4360599Sbde
4490559SmpFILESDIR= ${SHAREDIR}/examples/tcsh
4590559SmpFILES= complete.tcsh csh-mode.el
4690559Smp
4799257SruCATALOGS=	et:et_EE.ISO8859-15 \
4899257Sru		finnish:fi_FI.ISO8859-1 \
4999257Sru		french:fr_FR.ISO8859-1 \
5099257Sru		german:de_DE.ISO8859-1 \
5199257Sru		greek:el_GR.ISO8859-7 \
5299257Sru		italian:it_IT.ISO8859-1 \
5399257Sru		ja:ja_JP.eucJP \
5499257Sru		russian:ru_RU.KOI8-R \
5599257Sru		spanish:es_ES.ISO8859-1 \
5699257Sru		ukrainian:uk_UA.KOI8-U
5799257Sru
5899257SruNLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
5999257SruNLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
6099257Sru		fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
6199257Sru		fr_CH.ISO8859-15 fr_FR.ISO8859-15
6299257SruNLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
6399257Sru		de_CH.ISO8859-15 de_DE.ISO8859-15
6499257SruNLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
6599257SruNLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
6699257Sru
6799257SruNLSNAME= tcsh
6899257Sru
6999257Sru.for catalog in ${CATALOGS}
7099257SruNLS+=		${catalog:C/.*://}
7199257SruNLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
7299257SruNLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
7399257Sru.endfor
7499257Sru
7559355Sobriencsh.1: tcsh.man
76115898Skuriyama	cat ${.ALLSRC} > ${.TARGET}
771556Srgrimes
7869551Sachebuild-tools: gethost
7969551Sache
8069415Sachegethost: gethost.c sh.err.h tc.const.h sh.h
8169415Sache	@rm -f ${.TARGET}
8269415Sache	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
8369415Sache
8469415Sachetc.defs.c: gethost ${.CURDIR}/host.defs
8569415Sache	@rm -f ${.TARGET}
8669415Sache	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
8769415Sache	./gethost ${.CURDIR}/host.defs >> ${.TARGET}
8869415Sache
8959355Sobriened.defns.h: ed.defns.c
9027965Ssteve	@rm -f ${.TARGET}
9127965Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
9259355Sobrien	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
9359355Sobrien	@echo '#define _h_ed_defns' >> ${.TARGET}
9459355Sobrien	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
9559355Sobrien	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
9659355Sobrien
9759355Sobriensh.err.h: sh.err.c
9859355Sobrien	@rm -f ${.TARGET}
9959355Sobrien	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
10059355Sobrien	@echo '#ifndef _h_sh_err' >> ${.TARGET}
10159355Sobrien	@echo '#define _h_sh_err' >> ${.TARGET}
10269415Sache	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
10359355Sobrien	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
1041556Srgrimes
10559355Sobrientc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
10627969Ssteve	@rm -f ${.TARGET}
10727969Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
10859355Sobrien	@echo '#ifndef _h_tc_const' >> ${.TARGET}
10959355Sobrien	@echo '#define _h_tc_const' >> ${.TARGET}
11069415Sache	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
1111556Srgrimes	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
11227969Ssteve	    sort >> ${.TARGET}
11359355Sobrien	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
1141556Srgrimes
1151556Srgrimes.include <bsd.prog.mk>
116