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