Makefile revision 265420
1127808Snectar# $FreeBSD: head/bin/csh/Makefile 265420 2014-05-06 04:22:01Z imp $
2127808Snectar#	@(#)Makefile	8.1 (Berkeley) 5/31/93
3127808Snectar#
4127808Snectar# C Shell with process control; VM/UNIX VAX Makefile
5127808Snectar# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
6127808Snectar#
7103423Snectar# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
8103423Snectar
9103423Snectar.include <src.opts.mk>
10103423Snectar
11102644SnectarTCSHDIR= ${.CURDIR}/../../contrib/tcsh
12102644Snectar.PATH: ${TCSHDIR}
13103423Snectar
14103423SnectarPROG=	csh
15103423Snectar.if defined(RESCUE)
16103423SnectarDFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
17102644Snectar.else
18102644SnectarDFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
19102644Snectar.endif
20102644SnectarCFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
21102644SnectarWARNS?=	1
22102644SnectarSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
23102644Snectar	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
24102644Snectar	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
25102644Snectar	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
26102644SnectarSRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
27102644SnectarSRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
28102644Snectar	tw.comp.c tw.color.c
29102644SnectarSRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
30102644Snectar	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
31102644SnectarSRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
32102644Snectar	tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
33102644Snectar	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
34102644Snectar	tc.who.c tc.h
35102644SnectarGENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
36102644SnectarSRCS+=	${GENHDRS}
37102644Snectar
38102644SnectarMLINKS= csh.1 tcsh.1
39102644Snectar# MLINKS for Shell built in commands for which there are no userland
40102644Snectar# utilities of the same name are handled with the associated manpage,
41102644Snectar# builtin.1 in share/man/man1/.
42102644Snectar
43102644SnectarDPADD=	${LIBTERMCAP} ${LIBCRYPT}
44102644SnectarLDADD=	-ltermcap -lcrypt
45102644Snectar
46102644SnectarLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
47102644Snectar
48102644SnectarCLEANFILES= ${GENHDRS} gethost csh.1
4990926Snectar
5090926Snectar.if ${MK_EXAMPLES} != "no"
5190926SnectarFILESDIR= ${SHAREDIR}/examples/tcsh
5290926SnectarFILES= complete.tcsh csh-mode.el
5390926Snectar.endif
5490926Snectar
5590926SnectarCATALOGS=	et:et_EE.ISO8859-15 \
5690926Snectar		finnish:fi_FI.ISO8859-1 \
5790926Snectar		french:fr_FR.ISO8859-1 \
5890926Snectar		german:de_DE.ISO8859-1 \
5990926Snectar		greek:el_GR.ISO8859-7 \
6090926Snectar		italian:it_IT.ISO8859-1 \
6190926Snectar		ja:ja_JP.eucJP \
6290926Snectar		russian:ru_RU.KOI8-R \
6390926Snectar		spanish:es_ES.ISO8859-1 \
6490926Snectar		ukrainian:uk_UA.KOI8-U
6590926Snectar
6690926SnectarNLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
6790926SnectarNLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
6890926Snectar		fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
6990926Snectar		fr_CH.ISO8859-15 fr_FR.ISO8859-15
7090926SnectarNLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
7190926Snectar		de_CH.ISO8859-15 de_DE.ISO8859-15
7290926SnectarNLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
7390926SnectarNLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
7490926Snectar
7590926Snectar.if ${MK_NLS_CATALOGS} == "no" || defined(RESCUE)
7690926SnectarCFLAGS+= -DNO_NLS_CATALOGS
7790926Snectar.else
7890926SnectarCFLAGS+= -DHAVE_ICONV
7990926Snectar.if ${MK_ICONV} != "no"
8090926SnectarNLSLINKS_de_DE.ISO8859-1 += de_AT.UTF-8 de_CH.UTF-8 de_DE.UTF-8
8190926SnectarNLSLINKS_el_GR.ISO8859-7 = el_GR.UTF-8
8290926SnectarNLSLINKS_es_ES.ISO8859-1 += es_ES.UTF-8
8390926SnectarNLSLINKS_et_EE.ISO8859-15 = et_EE.UTF-8
8478527SassarNLSLINKS_fi_FI.ISO8859-1 += fi_FI.UTF-8
8578527SassarNLSLINKS_fr_FR.ISO8859-1 += fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8 fr_FR.UTF-8
8678527SassarNLSLINKS_it_IT.ISO8859-1 += it_CH.UTF-8 it_IT.UTF-8
8778527SassarNLSLINKS_ja_JP.eucJP = ja_JP.SJIS ja_JP.UTF-8
8878527SassarNLSLINKS_ru_RU.KOI8-R = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.UTF-8
8978527SassarNLSLINKS_uk_UA.KOI8-U = uk_UA.ISO8859-5 uk_UA.UTF-8
9078527Sassar.else
9178527Sassar# Above links can be installed from ports/shells/tcsh_nls
9278527Sassar
9378527SassarGENHDRS+= iconv.h
9478527SassarSRCS+=	iconv_stub.c
9578527Sassar
9678527Sassariconv.h: ${.CURDIR}/iconv_stub.h
9778527Sassar	cp ${.CURDIR}/iconv_stub.h ${.TARGET}
9878527Sassar.endif
9978527Sassar.endif
10078527Sassar
10178527SassarNLSNAME= tcsh
10278527Sassar
10378527Sassar.for catalog in ${CATALOGS}
10478527SassarNLS+=		${catalog:C/.*://}
10578527SassarNLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
10678527SassarNLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo charset set[0-9]*
10778527Sassar.endfor
10878527Sassar
10978527Sassarcsh.1: tcsh.man
11078527Sassar	cat ${.ALLSRC} > ${.TARGET}
11178527Sassar
11278527Sassarbuild-tools: gethost
11378527Sassar
11478527Sassargethost: gethost.c sh.err.h tc.const.h sh.h
11578527Sassar	@rm -f ${.TARGET}
11678527Sassar	${CC} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \
11772445Sassar	    ${TCSHDIR}/gethost.c
11872445Sassar
11972445Sassartc.defs.c: gethost ${TCSHDIR}/host.defs
12072445Sassar	@rm -f ${.TARGET}
12172445Sassar	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
12272445Sassar	./gethost ${TCSHDIR}/host.defs >> ${.TARGET}
12372445Sassar
12472445Sassared.defns.h: ed.defns.c
12572445Sassar	@rm -f ${.TARGET}
12672445Sassar	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
12772445Sassar	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
12872445Sassar	@echo '#define _h_ed_defns' >> ${.TARGET}
12972445Sassar	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
13072445Sassar	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
13172445Sassar
13272445Sassarsh.err.h: sh.err.c
13372445Sassar	@rm -f ${.TARGET}
13472445Sassar	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
13572445Sassar	@echo '#ifndef _h_sh_err' >> ${.TARGET}
13672445Sassar	@echo '#define _h_sh_err' >> ${.TARGET}
13772445Sassar	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
13872445Sassar	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
13972445Sassar
14078527Sassartc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
14178527Sassar	@rm -f ${.TARGET}
14278527Sassar	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
14372445Sassar	@echo '#ifndef _h_tc_const' >> ${.TARGET}
14472445Sassar	@echo '#define _h_tc_const' >> ${.TARGET}
14572445Sassar	${CC} -E ${CFLAGS:C/-DHAVE_ICONV//} ${.ALLSRC} -D_h_tc_const | \
14672445Sassar	    grep 'Char STR' | \
14772445Sassar	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
14872445Sassar	    sort >> ${.TARGET}
14972445Sassar	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
15072445Sassar
15172445Sassar.include <bsd.prog.mk>
15272445Sassar