Merge branch 'vendor/FILE'
[dragonfly.git] / bin / csh / Makefile
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
9 WARNS?= 2
10
11 TCSHDIR= ${.CURDIR}/../../contrib/tcsh-6
12 CONTRIBDIR=${TCSHDIR}
13 .PATH: ${TCSHDIR}
14
15 PROG=   csh
16 DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
17 CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
18 SRCS=   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
22 SRCS+=  sh.decls.h glob.c glob.h mi.termios.c dotlock.c
23 SRCS+=  tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
24         tw.comp.c tw.color.c
25 SRCS+=  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
27 SRCS+=  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
31 GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
32 SRCS+=  ${GENHDRS}
33
34 MLINKS= 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)
41 DPADD=  /usr/lib/libtermcap.a ${LIBCRYPT}
42 LDADD=  -ltermcap -lcrypt
43 .  else
44 .  if exists(/usr/lib/priv/libprivate_crypto.a)
45 DPADD=  ${LIBNCURSES} ${LIBCRYPT} ${LIBRECRYPTO}
46 LDADD=  -lprivate_ncurses -lcrypt -lprivate_crypto
47 LDFLAGS+=       ${PRIVATELIB_BLDFLAGS}
48 .  else
49 DPADD=  ${LIBNCURSES} ${LIBCRYPT} ${LIBRECRYPTO}
50 LDADD=  -lprivate_ncurses -lcrypt -lcrypto
51 LDFLAGS+=       ${PRIVATELIB_BLDFLAGS}
52 .  endif
53 .  endif
54 .else
55 DPADD=  ${LIBNCURSES} ${LIBCRYPT} ${LIBRECRYPTO}
56 LDADD=  -lprivate_ncurses -lcrypt -lprivate_crypto
57 LDFLAGS+=       ${PRIVATELIB_LDFLAGS}
58 .endif
59
60 .if defined(BOOTSTRAPPING)
61 . if ${CFLAGS:M-flto}
62 LDFLAGS+=       -Wl,--allow-multiple-definition
63 . endif
64 .endif
65
66 LINKS=  ${BINDIR}/csh ${BINDIR}/tcsh
67
68 CLEANFILES= ${GENHDRS} gethost.nx csh.1
69
70 FILESDIR= ${SHAREDIR}/examples/tcsh
71 FILES= complete.tcsh
72
73 CATALOGS=       et:et_EE.ISO8859-15 \
74                 finnish:fi_FI.ISO8859-1 \
75                 french:fr_FR.ISO8859-1 \
76                 german:de_DE.ISO8859-1 \
77                 greek:el_GR.ISO8859-7 \
78                 italian:it_IT.ISO8859-1 \
79                 ja:ja_JP.eucJP \
80                 russian:ru_RU.KOI8-R \
81                 spanish:es_ES.ISO8859-1 \
82                 ukrainian:uk_UA.KOI8-U
83
84 NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
85 NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
86                 fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
87                 fr_CH.ISO8859-15 fr_FR.ISO8859-15
88 NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
89                 de_CH.ISO8859-15 de_DE.ISO8859-15
90 NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
91 NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
92
93 NLSNAME= tcsh
94
95 .for catalog in ${CATALOGS}
96 NLS+=           ${catalog:C/.*://}
97 NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
98 NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
99 .endfor
100
101 csh.1: tcsh.man
102         ${LN} -sf ${.ALLSRC} ${.TARGET}
103
104 build-tools: gethost.nx
105
106 gethost.nx: gethost.c sh.err.h tc.const.h sh.h
107
108 tc.defs.c: gethost.nx ${.CURDIR}/host.defs
109         @rm -f ${.TARGET}
110         @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
111         ./gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
112
113 ed.defns.h: ed.defns.c
114         @rm -f ${.TARGET}
115         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
116         @echo '#ifndef _h_ed_defns' >> ${.TARGET}
117         @echo '#define _h_ed_defns' >> ${.TARGET}
118         grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
119         @echo '#endif /* _h_ed_defns */' >> ${.TARGET}
120
121 sh.err.h: sh.err.c
122         @rm -f ${.TARGET}
123         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
124         @echo '#ifndef _h_sh_err' >> ${.TARGET}
125         @echo '#define _h_sh_err' >> ${.TARGET}
126         grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
127         @echo '#endif /* _h_sh_err */' >> ${.TARGET}
128
129 tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
130         @rm -f ${.TARGET}
131         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
132         @echo '#ifndef _h_tc_const' >> ${.TARGET}
133         @echo '#define _h_tc_const' >> ${.TARGET}
134         ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
135             sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
136             sort >> ${.TARGET}
137         @echo '#endif /* _h_tc_const */' >> ${.TARGET}
138
139 .include <bsd.prog.mk>