Merge from vendor branch LIBPCAP:
[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.3 2004/03/22 20:57:23 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
10 TCSHDIR= ${.CURDIR}/../../contrib/tcsh
11 .PATH: ${TCSHDIR}
12
13 PROG=   csh
14 SUBDIR= nls
15 DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
16 CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
17 SRCS=   sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
18         sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
19         sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
20         sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
21 SRCS+=  sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
22 SRCS+=  tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
23         tw.comp.c tw.color.c
24 SRCS+=  ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
25         ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
26 SRCS+=  tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
27         tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
28         tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
29         tc.who.c tc.h
30 GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
31 SRCS+=  ${GENHDRS}
32
33 MLINKS= csh.1 tcsh.1
34 # MLINKS for Shell built in commands for which there are no userland
35 # utilities of the same name are handled with the associated manpage,
36 # builtin.1 in share/man/man1/.
37
38 DPADD=  ${LIBTERMCAP} ${LIBCRYPT}
39 LDADD=  -ltermcap -lcrypt
40
41 LINKS=  ${BINDIR}/csh ${BINDIR}/tcsh
42
43 CLEANFILES= ${GENHDRS} gethost.nx csh.1
44
45 FILESDIR= ${SHAREDIR}/examples/tcsh
46 FILES= complete.tcsh csh-mode.el
47
48 csh.1: tcsh.man
49         ln -sf ${.ALLSRC} ${.TARGET}
50
51 build-tools: gethost.nx
52
53 gethost.nx: gethost.c sh.err.h tc.const.h sh.h
54
55 tc.defs.c: gethost.nx ${.CURDIR}/host.defs
56         @rm -f ${.TARGET}
57         @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
58         ./gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
59
60 ed.defns.h: ed.defns.c
61         @rm -f ${.TARGET}
62         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
63         @echo '#ifndef _h_ed_defns' >> ${.TARGET}
64         @echo '#define _h_ed_defns' >> ${.TARGET}
65         grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
66         @echo '#endif /* _h_ed_defns */' >> ${.TARGET}
67
68 sh.err.h: sh.err.c
69         @rm -f ${.TARGET}
70         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
71         @echo '#ifndef _h_sh_err' >> ${.TARGET}
72         @echo '#define _h_sh_err' >> ${.TARGET}
73         grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
74         @echo '#endif /* _h_sh_err */' >> ${.TARGET}
75
76 tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
77         @rm -f ${.TARGET}
78         @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
79         @echo '#ifndef _h_tc_const' >> ${.TARGET}
80         @echo '#define _h_tc_const' >> ${.TARGET}
81         ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
82             sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
83             sort >> ${.TARGET}
84         @echo '#endif /* _h_tc_const */' >> ${.TARGET}
85
86 .include <bsd.prog.mk>