Patch out tcsh's use of 'exp2', which is math-reserved in gcc-3.4.
[dragonfly.git] / bin / csh / Makefile
... / ...
CommitLineData
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.4 2004/07/27 21:01:44 dillon 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
10TCSHDIR= ${.CURDIR}/../../contrib/tcsh
11CONTRIBDIR=${TCSHDIR}
12.PATH: ${TCSHDIR}
13
14PROG= csh
15SUBDIR= nls
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 mi.wait.h mi.varargs.h
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.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}
33SRCS+= sh.exp.c.patch
34
35MLINKS= csh.1 tcsh.1
36# MLINKS for Shell built in commands for which there are no userland
37# utilities of the same name are handled with the associated manpage,
38# builtin.1 in share/man/man1/.
39
40DPADD= ${LIBTERMCAP} ${LIBCRYPT}
41LDADD= -ltermcap -lcrypt
42
43LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
44
45CLEANFILES= ${GENHDRS} gethost.nx csh.1
46
47FILESDIR= ${SHAREDIR}/examples/tcsh
48FILES= complete.tcsh csh-mode.el
49
50csh.1: tcsh.man
51 ln -sf ${.ALLSRC} ${.TARGET}
52
53build-tools: gethost.nx
54
55gethost.nx: gethost.c sh.err.h tc.const.h sh.h
56
57tc.defs.c: gethost.nx ${.CURDIR}/host.defs
58 @rm -f ${.TARGET}
59 @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
60 ./gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
61
62ed.defns.h: ed.defns.c
63 @rm -f ${.TARGET}
64 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
65 @echo '#ifndef _h_ed_defns' >> ${.TARGET}
66 @echo '#define _h_ed_defns' >> ${.TARGET}
67 grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
68 @echo '#endif /* _h_ed_defns */' >> ${.TARGET}
69
70sh.err.h: sh.err.c
71 @rm -f ${.TARGET}
72 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
73 @echo '#ifndef _h_sh_err' >> ${.TARGET}
74 @echo '#define _h_sh_err' >> ${.TARGET}
75 grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
76 @echo '#endif /* _h_sh_err */' >> ${.TARGET}
77
78tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
79 @rm -f ${.TARGET}
80 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
81 @echo '#ifndef _h_tc_const' >> ${.TARGET}
82 @echo '#define _h_tc_const' >> ${.TARGET}
83 ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
84 sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
85 sort >> ${.TARGET}
86 @echo '#endif /* _h_tc_const */' >> ${.TARGET}
87
88.include <bsd.prog.mk>