Makefile revision 90559
1# $FreeBSD: head/bin/csh/Makefile 90559 2002-02-12 04:50:12Z mp $
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='"/bin/${PROG}"'
15CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
16WARNS=	0
17WFORMAT=0
18SRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
19	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
20	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
21	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h
22SRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
23SRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
24	tw.comp.c tw.color.c
25SRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
26	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
27SRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
28	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
29	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
30	tc.who.c tc.h
31GENHDRS= ed.defns.h sh.err.h tc.const.h tc.defs.c
32SRCS+=	${GENHDRS}
33
34MLINKS= csh.1 tcsh.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=	${LIBTERMCAP} ${LIBCRYPT}
40LDADD=	-ltermcap -lcrypt
41
42LINKS=	${BINDIR}/csh ${BINDIR}/tcsh
43
44CLEANFILES= ${GENHDRS} gethost csh.1
45
46FILESDIR= ${SHAREDIR}/examples/tcsh
47FILES= complete.tcsh csh-mode.el
48
49csh.1: tcsh.man
50	ln -sf ${.ALLSRC} ${.TARGET}
51
52build-tools: gethost
53
54gethost: gethost.c sh.err.h tc.const.h sh.h
55	@rm -f ${.TARGET}
56	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
57
58tc.defs.c: gethost ${.CURDIR}/host.defs
59	@rm -f ${.TARGET}
60	@echo "/* Do not edit this file, make creates it */" > ${.TARGET}
61	./gethost ${.CURDIR}/host.defs >> ${.TARGET}
62
63ed.defns.h: ed.defns.c
64	@rm -f ${.TARGET}
65	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
66	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
67	@echo '#define _h_ed_defns' >> ${.TARGET}
68	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
69	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
70
71sh.err.h: sh.err.c
72	@rm -f ${.TARGET}
73	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
74	@echo '#ifndef _h_sh_err' >> ${.TARGET}
75	@echo '#define _h_sh_err' >> ${.TARGET}
76	grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET}
77	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
78
79tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
80	@rm -f ${.TARGET}
81	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
82	@echo '#ifndef _h_tc_const' >> ${.TARGET}
83	@echo '#define _h_tc_const' >> ${.TARGET}
84	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
85	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
86	    sort >> ${.TARGET}
87	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
88
89.include <bsd.prog.mk>
90