Makefile revision 148673
1218885Sdim# $FreeBSD: head/bin/csh/Makefile 148673 2005-08-03 09:22:03Z phk $
2218885Sdim#	@(#)Makefile	8.1 (Berkeley) 5/31/93
3218885Sdim#
4218885Sdim# C Shell with process control; VM/UNIX VAX Makefile
5218885Sdim# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
6218885Sdim#
7218885Sdim# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
8218885Sdim
9218885SdimTCSHDIR= ${.CURDIR}/../../contrib/tcsh
10218885Sdim.PATH: ${TCSHDIR}
11218885Sdim
12218885SdimPROG=	csh
13218885Sdim.if defined(RESCUE)
14218885SdimDFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
15218885Sdim.else
16218885SdimDFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
17218885Sdim.endif
18218885SdimCFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
19218885SdimWARNS?=	0
20218885SdimSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
21218885Sdim	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
22218885Sdim	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
23218885Sdim	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
24218885SdimSRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
25218885SdimSRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
26218885Sdim	tw.comp.c tw.color.c
27218885SdimSRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
28218885Sdim	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
29218885SdimSRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
30218885Sdim	tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
31218885Sdim	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
32218885Sdim	tc.who.c tc.h
33218885SdimGENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
34218885SdimSRCS+=	${GENHDRS}
35218885Sdim
36218885SdimMLINKS= csh.1 tcsh.1
37218885Sdim# MLINKS for Shell built in commands for which there are no userland
38218885Sdim# utilities of the same name are handled with the associated manpage,
39218885Sdim# builtin.1 in share/man/man1/.
40218885Sdim
41218885SdimDPADD=	${LIBTERMCAP} ${LIBCRYPT}
42218885SdimLDADD=	-ltermcap -lcrypt
43218885Sdim
44218885SdimLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
45218885Sdim
46218885SdimCLEANFILES= ${GENHDRS} gethost csh.1
47218885Sdim
48218885Sdim.if !defined(NO_EXAMPLES)
49218885SdimFILESDIR= ${SHAREDIR}/examples/tcsh
50218885SdimFILES= complete.tcsh csh-mode.el
51218885Sdim.endif
52218885Sdim
53218885SdimCATALOGS=	et:et_EE.ISO8859-15 \
54218885Sdim		finnish:fi_FI.ISO8859-1 \
55218885Sdim		french:fr_FR.ISO8859-1 \
56218885Sdim		german:de_DE.ISO8859-1 \
57218885Sdim		greek:el_GR.ISO8859-7 \
58218885Sdim		italian:it_IT.ISO8859-1 \
59218885Sdim		ja:ja_JP.eucJP \
60218885Sdim		russian:ru_RU.KOI8-R \
61218885Sdim		spanish:es_ES.ISO8859-1 \
62218885Sdim		ukrainian:uk_UA.KOI8-U
63218885Sdim
64218885SdimNLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
65218885SdimNLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
66218885Sdim		fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
67218885Sdim		fr_CH.ISO8859-15 fr_FR.ISO8859-15
68218885SdimNLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
69218885Sdim		de_CH.ISO8859-15 de_DE.ISO8859-15
70218885SdimNLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
71218885SdimNLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
72218885Sdim
73218885SdimNLSNAME= tcsh
74218885Sdim
75218885Sdim.for catalog in ${CATALOGS}
76218885SdimNLS+=		${catalog:C/.*://}
77218885SdimNLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
78218885SdimNLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
79218885Sdim.endfor
80218885Sdim
81218885Sdimcsh.1: tcsh.man
82218885Sdim	cat ${.ALLSRC} > ${.TARGET}
83218885Sdim
84218885Sdimbuild-tools: gethost
85218885Sdim
86218885Sdimgethost: gethost.c sh.err.h tc.const.h sh.h
87218885Sdim	@rm -f ${.TARGET}
88218885Sdim	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
89218885Sdim
90218885Sdimtc.defs.c: gethost ${.CURDIR}/host.defs
91218885Sdim	@rm -f ${.TARGET}
92218885Sdim	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
93218885Sdim	./gethost ${.CURDIR}/host.defs >> ${.TARGET}
94218885Sdim
95218885Sdimed.defns.h: ed.defns.c
96218885Sdim	@rm -f ${.TARGET}
97218885Sdim	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
98218885Sdim	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
99218885Sdim	@echo '#define _h_ed_defns' >> ${.TARGET}
100218885Sdim	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
101218885Sdim	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
102218885Sdim
103218885Sdimsh.err.h: sh.err.c
104218885Sdim	@rm -f ${.TARGET}
105218885Sdim	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
106218885Sdim	@echo '#ifndef _h_sh_err' >> ${.TARGET}
107218885Sdim	@echo '#define _h_sh_err' >> ${.TARGET}
108218885Sdim	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
109218885Sdim	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
110218885Sdim
111218885Sdimtc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
112218885Sdim	@rm -f ${.TARGET}
113218885Sdim	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
114218885Sdim	@echo '#ifndef _h_tc_const' >> ${.TARGET}
115218885Sdim	@echo '#define _h_tc_const' >> ${.TARGET}
116218885Sdim	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
117218885Sdim	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
118218885Sdim	    sort >> ${.TARGET}
119218885Sdim	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
120218885Sdim
121218885Sdim.include <bsd.prog.mk>
122218885Sdim