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