Makefile revision 156813
150471Speter# $FreeBSD: head/bin/csh/Makefile 156813 2006-03-17 18:54:44Z ru $
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
9156813Sru.include <bsd.own.mk>
10156813Sru
1159576SobrienTCSHDIR= ${.CURDIR}/../../contrib/tcsh
1259355Sobrien.PATH: ${TCSHDIR}
1359355Sobrien
141556SrgrimesPROG=	csh
15117036Sgordon.if defined(RESCUE)
16117036SgordonDFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
17117036Sgordon.else
1869551SacheDFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
19117036Sgordon.endif
2069640SobrienCFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
21126173SjohanWARNS?=	0
2259355SobrienSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
2359355Sobrien	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
2459355Sobrien	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
2569415Sache	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
2659355SobrienSRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
2759355SobrienSRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
2859355Sobrien	tw.comp.c tw.color.c
2959355SobrienSRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
3059355Sobrien	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
3159355SobrienSRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
32145481Smp	tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
3359355Sobrien	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
3459355Sobrien	tc.who.c tc.h
3569415SacheGENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
3660599SbdeSRCS+=	${GENHDRS}
371556Srgrimes
3860029SjkoshyMLINKS= csh.1 tcsh.1
3951090Ssheldonh# MLINKS for Shell built in commands for which there are no userland
4051090Ssheldonh# utilities of the same name are handled with the associated manpage,
4151090Ssheldonh# builtin.1 in share/man/man1/.
4251090Ssheldonh
4362759SacheDPADD=	${LIBTERMCAP} ${LIBCRYPT}
4462759SacheLDADD=	-ltermcap -lcrypt
451556Srgrimes
4659393SobrienLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
4759393Sobrien
4869415SacheCLEANFILES= ${GENHDRS} gethost csh.1
4960599Sbde
50156813Sru.if ${MK_EXAMPLES} != "no"
5190559SmpFILESDIR= ${SHAREDIR}/examples/tcsh
5290559SmpFILES= complete.tcsh csh-mode.el
53148673Sphk.endif
5490559Smp
5599257SruCATALOGS=	et:et_EE.ISO8859-15 \
5699257Sru		finnish:fi_FI.ISO8859-1 \
5799257Sru		french:fr_FR.ISO8859-1 \
5899257Sru		german:de_DE.ISO8859-1 \
5999257Sru		greek:el_GR.ISO8859-7 \
6099257Sru		italian:it_IT.ISO8859-1 \
6199257Sru		ja:ja_JP.eucJP \
6299257Sru		russian:ru_RU.KOI8-R \
6399257Sru		spanish:es_ES.ISO8859-1 \
6499257Sru		ukrainian:uk_UA.KOI8-U
6599257Sru
6699257SruNLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
6799257SruNLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
6899257Sru		fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
6999257Sru		fr_CH.ISO8859-15 fr_FR.ISO8859-15
7099257SruNLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
7199257Sru		de_CH.ISO8859-15 de_DE.ISO8859-15
7299257SruNLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
7399257SruNLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
7499257Sru
75156813Sru.if ${MK_NLS_CATALOGS} == "no" || defined(RESCUE)
76155835SumeCFLAGS+= -DNO_NLS_CATALOGS
77155835Sume.else
78155835SumeCFLAGS+= -DHAVE_ICONV
79155835SumeSRCS+=	iconv_stub.c
80155835Sume# Folloing links can be installed from ports/shells/tcsh_nls:
81155835Sume# NLSLINKS_de_DE.ISO8859-1 += de_AT.UTF-8 de_CH.UTF-8 de_DE.UTF-8
82155835Sume# NLSLINKS_el_GR.ISO8859-7 = el_GR.UTF-8
83155835Sume# NLSLINKS_es_ES.ISO8859-1 += es_ES.UTF-8
84155835Sume# NLSLINKS_et_EE.ISO8859-15 = et_EE.UTF-8
85155835Sume# NLSLINKS_fi_FI.ISO8859-1 += fi_FI.UTF-8
86155835Sume# NLSLINKS_fr_FR.ISO8859-1 += fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8 fr_FR.UTF-8
87155835Sume# NLSLINKS_it_IT.ISO8859-1 += it_CH.UTF-8 it_IT.UTF-8
88155835Sume# NLSLINKS_ja_JP.eucJP = ja_JP.SJIS ja_JP.UTF-8
89155835Sume# NLSLINKS_ru_RU.KOI8-R = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.UTF-8
90155835Sume# NLSLINKS_uk_UA.KOI8-U = uk_UA.ISO8859-5 uk_UA.UTF-8
91155835Sume.endif
92155835Sume
9399257SruNLSNAME= tcsh
9499257Sru
9599257Sru.for catalog in ${CATALOGS}
9699257SruNLS+=		${catalog:C/.*://}
9799257SruNLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
98155835SumeNLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo charset set[0-9]*
9999257Sru.endfor
10099257Sru
10159355Sobriencsh.1: tcsh.man
102115898Skuriyama	cat ${.ALLSRC} > ${.TARGET}
1031556Srgrimes
10469551Sachebuild-tools: gethost
10569551Sache
10669415Sachegethost: gethost.c sh.err.h tc.const.h sh.h
10769415Sache	@rm -f ${.TARGET}
10869415Sache	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
10969415Sache
11069415Sachetc.defs.c: gethost ${.CURDIR}/host.defs
11169415Sache	@rm -f ${.TARGET}
11269415Sache	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
11369415Sache	./gethost ${.CURDIR}/host.defs >> ${.TARGET}
11469415Sache
11559355Sobriened.defns.h: ed.defns.c
11627965Ssteve	@rm -f ${.TARGET}
11727965Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
11859355Sobrien	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
11959355Sobrien	@echo '#define _h_ed_defns' >> ${.TARGET}
12059355Sobrien	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
12159355Sobrien	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
12259355Sobrien
12359355Sobriensh.err.h: sh.err.c
12459355Sobrien	@rm -f ${.TARGET}
12559355Sobrien	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
12659355Sobrien	@echo '#ifndef _h_sh_err' >> ${.TARGET}
12759355Sobrien	@echo '#define _h_sh_err' >> ${.TARGET}
12869415Sache	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
12959355Sobrien	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
1301556Srgrimes
13159355Sobrientc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
13227969Ssteve	@rm -f ${.TARGET}
13327969Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
13459355Sobrien	@echo '#ifndef _h_tc_const' >> ${.TARGET}
13559355Sobrien	@echo '#define _h_tc_const' >> ${.TARGET}
13669415Sache	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
1371556Srgrimes	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
13827969Ssteve	    sort >> ${.TARGET}
13959355Sobrien	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
1401556Srgrimes
1411556Srgrimes.include <bsd.prog.mk>
142