xref: /freebsd/bin/csh/Makefile (revision ebbd4fa8c8427d3dd847ba33c45c996e0500e6ff)
1# $FreeBSD$
2#	@(#)Makefile	8.1 (Berkeley) 5/31/93
3#
4# C Shell with process control; VM/UNIX VAX Makefile
5# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
6#
7# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
8
9TCSHDIR= ${.CURDIR}/../../contrib/tcsh
10.PATH: ${TCSHDIR}
11
12PROG=	csh
13DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
14CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
15SRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
16	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
17	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
18	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
19SRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
20SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
21	tw.comp.c tw.color.c
22SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
23	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
24SRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
25	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
26	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
27	tc.who.c tc.h
28GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
29SRCS+=	${GENHDRS}
30
31MLINKS= csh.1 tcsh.1
32# MLINKS for Shell built in commands for which there are no userland
33# utilities of the same name are handled with the associated manpage,
34# builtin.1 in share/man/man1/.
35
36DPADD=	${LIBTERMCAP} ${LIBCRYPT}
37LDADD=	-ltermcap -lcrypt
38
39LINKS=	${BINDIR}/csh ${BINDIR}/tcsh
40
41CLEANFILES= ${GENHDRS} gethost csh.1
42
43FILESDIR= ${SHAREDIR}/examples/tcsh
44FILES= complete.tcsh csh-mode.el
45
46CATALOGS=	et:et_EE.ISO8859-15 \
47		finnish:fi_FI.ISO8859-1 \
48		french:fr_FR.ISO8859-1 \
49		german:de_DE.ISO8859-1 \
50		greek:el_GR.ISO8859-7 \
51		italian:it_IT.ISO8859-1 \
52		ja:ja_JP.eucJP \
53		russian:ru_RU.KOI8-R \
54		spanish:es_ES.ISO8859-1 \
55		ukrainian:uk_UA.KOI8-U
56
57NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
58NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
59		fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
60		fr_CH.ISO8859-15 fr_FR.ISO8859-15
61NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
62		de_CH.ISO8859-15 de_DE.ISO8859-15
63NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
64NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
65
66NLSNAME= tcsh
67
68.for catalog in ${CATALOGS}
69NLS+=		${catalog:C/.*://}
70NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
71NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
72.endfor
73
74csh.1: tcsh.man
75	ln -sf ${.ALLSRC} ${.TARGET}
76
77build-tools: gethost
78
79gethost: gethost.c sh.err.h tc.const.h sh.h
80	@rm -f ${.TARGET}
81	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
82
83tc.defs.c: gethost ${.CURDIR}/host.defs
84	@rm -f ${.TARGET}
85	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
86	./gethost ${.CURDIR}/host.defs >> ${.TARGET}
87
88ed.defns.h: ed.defns.c
89	@rm -f ${.TARGET}
90	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
91	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
92	@echo '#define _h_ed_defns' >> ${.TARGET}
93	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
94	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
95
96sh.err.h: sh.err.c
97	@rm -f ${.TARGET}
98	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
99	@echo '#ifndef _h_sh_err' >> ${.TARGET}
100	@echo '#define _h_sh_err' >> ${.TARGET}
101	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
102	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
103
104tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
105	@rm -f ${.TARGET}
106	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
107	@echo '#ifndef _h_tc_const' >> ${.TARGET}
108	@echo '#define _h_tc_const' >> ${.TARGET}
109	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
110	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
111	    sort >> ${.TARGET}
112	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
113
114.include <bsd.prog.mk>
115