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