Makefile revision 59393
150471Speter# $FreeBSD: head/bin/csh/Makefile 59393 2000-04-19 15:15:19Z obrien $
21556Srgrimes#	@(#)Makefile	8.1 (Berkeley) 5/31/93
31556Srgrimes#
41556Srgrimes# C Shell with process control; VM/UNIX VAX Makefile
51556Srgrimes# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
61556Srgrimes#
71556Srgrimes# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
81556Srgrimes
959355SobrienTCSHDIR=	${.CURDIR}/../../contrib/tcsh
1059355Sobrien.PATH: ${TCSHDIR}
1159355Sobrien
121556SrgrimesPROG=	csh
1359355SobrienDFLAGS=	-D_PATH_TCSHELL='"${DESTDIR}/bin/${PROG}"'  
1459355SobrienCFLAGS+= -I${TCSHDIR} -I${.CURDIR} -I. ${DFLAGS}
1559355SobrienSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
1659355Sobrien	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
1759355Sobrien	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
1859355Sobrien	sh.set.c sh.time.c sh.h sh.char.h sh.dir.h sh.proc.h
1959355SobrienSRCS+=	sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
2059355SobrienSRCS+=	tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
2159355Sobrien	tw.comp.c tw.color.c
2259355SobrienSRCS+=	ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
2359355Sobrien	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
2459355SobrienSRCS+=	tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
2559355Sobrien	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
2659355Sobrien	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
2759355Sobrien	tc.who.c tc.h
2859355SobrienSRCS+=	tc.defs.c
291556Srgrimes
301864SwollmanMAN1=	csh.1
3151090Ssheldonh# MLINKS for Shell built in commands for which there are no userland
3251090Ssheldonh# utilities of the same name are handled with the associated manpage,
3351090Ssheldonh# builtin.1 in share/man/man1/.
3451090Ssheldonh
3559355SobrienDPADD+=		${LIBNCURSES} ${LIBCRYPT}
3659355SobrienLDADD+=		-lncurses -lcrypt
371556Srgrimes
3859393SobrienLINKS=	${BINDIR}/csh ${BINDIR}/tcsh
3959393Sobrien
4059355Sobriencsh.1: tcsh.man
4159355Sobrien	ln -sf ${.ALLSRC} ${.TARGET}
421556Srgrimes
4359355SobrienGENHDRS+=	ed.defns.h tc.const.h sh.err.h
4459355SobrienSRCS+=		${GENHDRS}
4559355SobrienCLEANFILES+= ${GENHDRS}
4659355Sobrien
4759355Sobriened.defns.h: ed.defns.c
4827965Ssteve	@rm -f ${.TARGET}
4927965Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
5059355Sobrien	@echo '#ifndef _h_ed_defns' >> ${.TARGET}
5159355Sobrien	@echo '#define _h_ed_defns' >> ${.TARGET}
5259355Sobrien	grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
5359355Sobrien	@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
5459355Sobrien
5559355Sobriensh.err.h: sh.err.c
5659355Sobrien	@rm -f ${.TARGET}
5759355Sobrien	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
5859355Sobrien	@echo '#ifndef _h_sh_err' >> ${.TARGET}
5959355Sobrien	@echo '#define _h_sh_err' >> ${.TARGET}
6027965Ssteve	egrep 'ERR_' ${.ALLSRC} | egrep '^#define' >> ${.TARGET}
6159355Sobrien	@echo '#endif /* _h_sh_err */' >> ${.TARGET}
621556Srgrimes
6359355Sobrientc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
6427969Ssteve	@rm -f ${.TARGET}
6527969Ssteve	@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
6659355Sobrien	@echo '#ifndef _h_tc_const' >> ${.TARGET}
6759355Sobrien	@echo '#define _h_tc_const' >> ${.TARGET}
6859355Sobrien	${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | egrep 'Char STR' | \
691556Srgrimes	    sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
7027969Ssteve	    sort >> ${.TARGET}
7159355Sobrien	@echo '#endif /* _h_tc_const */' >> ${.TARGET}
721556Srgrimes
731556Srgrimes.include <bsd.prog.mk>
74