]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - bin/csh/Makefile
META_MODE: Don't rebuild build-tools targets during normal build.
[FreeBSD/FreeBSD.git] / bin / csh / Makefile
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
9 .include <src.opts.mk>
10
11 TCSHDIR= ${.CURDIR}/../../contrib/tcsh
12 .PATH: ${TCSHDIR}
13
14 PROG=   csh
15 .if defined(RESCUE)
16 DFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
17 .else
18 DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
19 .endif
20 CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
21 WARNS?= 1
22 SRCS=   sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
23         sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
24         sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
25         sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
26 SRCS+=  sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
27 SRCS+=  tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
28         tw.comp.c tw.color.c
29 SRCS+=  ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
30         ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
31 SRCS+=  tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
32         tc.func.c tc.nls.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
33         tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
34         tc.who.c tc.h
35 GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
36 SRCS+=  ${GENHDRS}
37
38 MLINKS= csh.1 tcsh.1
39 # MLINKS for Shell built in commands for which there are no userland
40 # utilities of the same name are handled with the associated manpage,
41 # builtin.1 in share/man/man1/.
42
43 LIBADD= termcapw crypt
44
45 LINKS=  ${BINDIR}/csh ${BINDIR}/tcsh
46
47 CLEANFILES= ${GENHDRS} gethost csh.1
48
49 .if ${MK_EXAMPLES} != "no"
50 FILESDIR= ${SHAREDIR}/examples/tcsh
51 FILES= complete.tcsh csh-mode.el
52 .endif
53
54 CATALOGS=       et:et_EE.UTF-8 \
55                 finnish:fi_FI.UTF-8 \
56                 french:fr_FR.UTF-8 \
57                 german:de_DE.UTF-8 \
58                 greek:el_GR.UTF-8 \
59                 italian:it_IT.UTF-8 \
60                 ja:ja_JP.UTF-8 \
61                 russian:ru_RU.UTF-8 \
62                 spanish:es_ES.UTF-8 \
63                 ukrainian:uk_UA.UTF-8
64
65 NLSLINKS_de_DE.UTF-8 = de_AT.UTF-8 de_CH.UTF-8
66 NLSLINKS_fr_FR.UTF-8 = fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8
67 NLSLINKS_it_IT.UTF-8 = it_CH.UTF-8
68
69 .if ${MK_NLS_CATALOGS} == "no" || defined(RESCUE)
70 CFLAGS+= -DNO_NLS_CATALOGS
71 .else
72 CFLAGS+= -DHAVE_ICONV
73 .if ${MK_ICONV} != "no"
74 NLSLINKS_de_DE.UTF-8 += de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
75                 de_CH.ISO8859-15 de_DE.ISO8859-1 de_DE.ISO8859-15
76 NLSLINKS_el_GR.UTF-8 = el_GR.ISO8859-7
77 NLSLINKS_es_ES.UTF-8 = es_ES.ISO8859-1 es_ES.ISO8859-15
78 NLSLINKS_et_EE.UTF-8 = et_EE.ISO8859-15
79 NLSLINKS_fi_FI.UTF-8 = fi_FI.ISO8859-1 fi_FI.ISO8859-15
80 NLSLINKS_fr_FR.UTF-8 += fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
81                 fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
82                 fr_CH.ISO8859-15 fr_FR.ISO8859-1 fr_FR.ISO8859-15
83 NLSLINKS_it_IT.UTF-8 += it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-1 \
84                 it_IT.ISO8859-15
85 NLSLINKS_ja_JP.UTF-8 = ja_JP.SJIS ja_JP.eucJP
86 NLSLINKS_ru_RU.UTF-8 = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R
87 NLSLINKS_uk_UA.UTF-8 = uk_UA.ISO8859-5 uk_UA.KOI8-U
88 .else
89 # Above links can be installed from ports/shells/tcsh_nls
90
91 GENHDRS+= iconv.h
92 SRCS+=  iconv_stub.c
93
94 iconv.h: ${.CURDIR}/iconv_stub.h
95         ${CP} ${.CURDIR}/iconv_stub.h ${.TARGET}
96 .endif
97 .endif
98
99 NLSNAME= tcsh
100
101 .for catalog in ${CATALOGS}
102 NLS+=           ${catalog:C/.*://}
103 NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
104 NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo charset set[0-9]*
105 .endfor
106
107 csh.1: tcsh.man
108         cat ${.ALLSRC} > ${.TARGET}
109
110 build-tools: gethost
111
112 gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META}
113         @rm -f ${.TARGET}
114         ${CC} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \
115             ${TCSHDIR}/gethost.c
116
117 tc.defs.c: gethost ${TCSHDIR}/host.defs
118         @rm -f ${.TARGET}
119         @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
120         ./gethost ${TCSHDIR}/host.defs >> ${.TARGET}
121
122 ed.defns.h: ed.defns.c
123         @rm -f ${.TARGET}
124         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
125         @echo '#ifndef _h_ed_defns' >> ${.TARGET}
126         @echo '#define _h_ed_defns' >> ${.TARGET}
127         grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
128         @echo '#endif /* _h_ed_defns */' >> ${.TARGET}
129
130 sh.err.h: sh.err.c
131         @rm -f ${.TARGET}
132         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
133         @echo '#ifndef _h_sh_err' >> ${.TARGET}
134         @echo '#define _h_sh_err' >> ${.TARGET}
135         grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
136         @echo '#endif /* _h_sh_err */' >> ${.TARGET}
137
138 tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
139         @rm -f ${.TARGET}
140         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
141         @echo '#ifndef _h_tc_const' >> ${.TARGET}
142         @echo '#define _h_tc_const' >> ${.TARGET}
143         ${CC:N${CCACHE_BIN}} -E ${CFLAGS:C/-DHAVE_ICONV//} ${.ALLSRC} -D_h_tc_const | \
144             grep 'Char STR' | \
145             sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
146             sort >> ${.TARGET}
147         @echo '#endif /* _h_tc_const */' >> ${.TARGET}
148
149 .include <bsd.prog.mk>