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.5 2005/02/06 06:16:39 okumoto Exp $
3 # @(#)Makefile 8.1 (Berkeley) 5/31/93
5 # C Shell with process control; VM/UNIX VAX Makefile
6 # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
8 # To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
12 TCSHDIR= ${.CURDIR}/../../contrib/tcsh
18 DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
19 CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
20 SRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
21 sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
22 sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
23 sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
24 SRCS+= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
25 SRCS+= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
27 SRCS+= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
28 ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
29 SRCS+= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
30 tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
31 tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
33 GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
38 # MLINKS for Shell built in commands for which there are no userland
39 # utilities of the same name are handled with the associated manpage,
40 # builtin.1 in share/man/man1/.
42 DPADD= ${LIBTERMCAP} ${LIBCRYPT}
43 LDADD= -ltermcap -lcrypt
45 LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
47 CLEANFILES= ${GENHDRS} gethost.nx csh.1
49 FILESDIR= ${SHAREDIR}/examples/tcsh
50 FILES= complete.tcsh csh-mode.el
53 ln -sf ${.ALLSRC} ${.TARGET}
55 build-tools: gethost.nx
57 gethost.nx: gethost.c sh.err.h tc.const.h sh.h
59 tc.defs.c: gethost.nx ${.CURDIR}/host.defs
61 @echo "/* Do not edit this file, make creates it */" > ${.TARGET}
62 ./gethost.nx ${.CURDIR}/host.defs >> ${.TARGET}
64 ed.defns.h: ed.defns.c
66 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
67 @echo '#ifndef _h_ed_defns' >> ${.TARGET}
68 @echo '#define _h_ed_defns' >> ${.TARGET}
69 grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
70 @echo '#endif /* _h_ed_defns */' >> ${.TARGET}
74 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
75 @echo '#ifndef _h_sh_err' >> ${.TARGET}
76 @echo '#define _h_sh_err' >> ${.TARGET}
77 grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
78 @echo '#endif /* _h_sh_err */' >> ${.TARGET}
80 tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
82 @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
83 @echo '#ifndef _h_tc_const' >> ${.TARGET}
84 @echo '#define _h_tc_const' >> ${.TARGET}
85 ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
86 sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
88 @echo '#endif /* _h_tc_const */' >> ${.TARGET}
90 .include <bsd.prog.mk>