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