Makefile revision 59432
1# $FreeBSD: head/bin/csh/Makefile 59432 2000-04-20 08:58:11Z ache $
2#	@(#)Makefile	8.1 (Berkeley) 5/31/93
3#
4# C Shell with process control; VM/UNIX VAX Makefile
5# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
6#
7# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
8
9TCSHDIR=	${.CURDIR}/../../contrib/tcsh
10.PATH: ${TCSHDIR}
11
12PROG=	csh
13SUBDIR= nls
14DFLAGS=	-D_PATH_TCSHELL='"${DESTDIR}/bin/${PROG}"'  
15CFLAGS+= -I${TCSHDIR} -I${.CURDIR} -I. ${DFLAGS}
16SRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
17	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
18	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
19	sh.set.c sh.time.c sh.h sh.char.h sh.dir.h sh.proc.h
20SRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
21SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
22	tw.comp.c tw.color.c
23SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
24	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
25SRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
26	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
27	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
28	tc.who.c tc.h
29SRCS+=	tc.defs.c
30
31MAN1=	csh.1
32# MLINKS for Shell built in commands for which there are no userland
33# utilities of the same name are handled with the associated manpage,
34# builtin.1 in share/man/man1/.
35
36DPADD+=		${LIBNCURSES} ${LIBCRYPT}
37LDADD+=		-lncurses -lcrypt
38
39LINKS=	${BINDIR}/csh ${BINDIR}/tcsh
40
41csh.1: tcsh.man
42	ln -sf ${.ALLSRC} ${.TARGET}
43
44GENHDRS+=	ed.defns.h tc.const.h sh.err.h
45SRCS+=		${GENHDRS}
46CLEANFILES+= ${GENHDRS}
47
48ed.defns.h: ed.defns.c
49	@rm -f ${.TARGET}
50	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
51	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
52	@echo '#define _h_ed_defns' >> ${.TARGET}
53	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
54	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
55
56sh.err.h: sh.err.c
57	@rm -f ${.TARGET}
58	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
59	@echo '#ifndef _h_sh_err' >> ${.TARGET}
60	@echo '#define _h_sh_err' >> ${.TARGET}
61	egrep 'ERR_' ${.ALLSRC} | egrep '^#define' >> ${.TARGET}
62	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
63
64tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
65	@rm -f ${.TARGET}
66	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
67	@echo '#ifndef _h_tc_const' >> ${.TARGET}
68	@echo '#define _h_tc_const' >> ${.TARGET}
69	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | egrep 'Char STR' | \
70	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
71	    sort >> ${.TARGET}
72	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
73
74.include <bsd.prog.mk>
75