Makefile revision 60599
1169695Skan# $FreeBSD: head/bin/csh/Makefile 60599 2000-05-15 14:24:32Z bde $
2169695Skan#	@(#)Makefile	8.1 (Berkeley) 5/31/93
3169695Skan#
4169695Skan# C Shell with process control; VM/UNIX VAX Makefile
5169695Skan# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
6169695Skan#
7169695Skan# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
8169695Skan
9169695SkanTCSHDIR= ${.CURDIR}/../../contrib/tcsh
10169695Skan.PATH: ${TCSHDIR}
11169695Skan
12169695SkanPROG=	csh
13169695SkanSUBDIR= nls
14169695SkanDFLAGS=	-D_PATH_TCSHELL='"${DESTDIR}/bin/${PROG}"'  
15169695Skan.if defined(WANT_KANJI)
16169695SkanDFLAGS+= -DWANT_KANJI
17169695Skan.endif
18169695SkanCFLAGS+= -I${TCSHDIR} -I${.CURDIR} -I. ${DFLAGS}
19169695SkanSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
20169695Skan	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
21169695Skan	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
22169695Skan	sh.set.c sh.time.c sh.h sh.char.h sh.dir.h sh.proc.h
23169695SkanSRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
24169695SkanSRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
25169695Skan	tw.comp.c tw.color.c
26169695SkanSRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
27169695Skan	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
28169695SkanSRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
29169695Skan	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
30169695Skan	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
31169695Skan	tc.who.c tc.h
32169695SkanSRCS+=	tc.defs.c
33169695SkanGENHDRS= ed.defns.h sh.err.h tc.const.h
34169695SkanSRCS+=	${GENHDRS}
35169695Skan
36169695SkanMAN1=	csh.1
37169695SkanMLINKS= csh.1 tcsh.1
38169695Skan# MLINKS for Shell built in commands for which there are no userland
39169695Skan# utilities of the same name are handled with the associated manpage,
40169695Skan# builtin.1 in share/man/man1/.
41169695Skan
42169695SkanDPADD=	${LIBNCURSES} ${LIBCRYPT}
43169695SkanLDADD=	-lncurses -lcrypt
44169695Skan
45169695SkanLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
46169695Skan
47169695SkanCLEANFILES= ${GENHDRS} csh.1
48169695Skan
49169695Skancsh.1: tcsh.man
50169695Skan	ln -sf ${.ALLSRC} ${.TARGET}
51169695Skan
52169695Skaned.defns.h: ed.defns.c
53169695Skan	@rm -f ${.TARGET}
54169695Skan	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
55169695Skan	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
56169695Skan	@echo '#define _h_ed_defns' >> ${.TARGET}
57169695Skan	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
58169695Skan	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
59169695Skan
60169695Skansh.err.h: sh.err.c
61169695Skan	@rm -f ${.TARGET}
62169695Skan	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
63169695Skan	@echo '#ifndef _h_sh_err' >> ${.TARGET}
64169695Skan	@echo '#define _h_sh_err' >> ${.TARGET}
65169695Skan	egrep 'ERR_' ${.ALLSRC} | egrep '^#define' >> ${.TARGET}
66169695Skan	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
67169695Skan
68169695Skantc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
69169695Skan	@rm -f ${.TARGET}
70169695Skan	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
71169695Skan	@echo '#ifndef _h_tc_const' >> ${.TARGET}
72169695Skan	@echo '#define _h_tc_const' >> ${.TARGET}
73169695Skan	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | egrep 'Char STR' | \
74169695Skan	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
75169695Skan	    sort >> ${.TARGET}
76169695Skan	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
77169695Skan
78169695Skan.include <bsd.prog.mk>
79169695Skan