Makefile revision 51090
117987Speter#	@(#)Makefile	8.4 (Berkeley) 5/5/95
250471Speter# $FreeBSD: head/bin/sh/Makefile 51090 1999-09-08 15:40:46Z sheldonh $
31556Srgrimes
41556SrgrimesPROG=	sh
535783SbdeSHSRCS=	alias.c arith.y arith_lex.l cd.c echo.c error.c eval.c exec.c expand.c \
61556Srgrimes	histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
725221Ssteve	mystring.c options.c output.c parser.c printf.c redir.c show.c \
825221Ssteve	trap.c var.c
935783SbdeGENSRCS= builtins.c init.c nodes.c syntax.c
1035783SbdeGENHDRS= builtins.h nodes.h syntax.h token.h y.tab.h
1135783SbdeSRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} y.tab.h
1217987Speter
1351090Ssheldonh# MLINKS for Shell built in commands for which there are no userland
1451090Ssheldonh# utilities of the same name are handled with the associated manpage,
1551090Ssheldonh# builtin.1 in share/man/man1/.  
1651090Ssheldonh
1725903SsteveDPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
1825221SsteveLDADD+= -ll -ledit -ltermcap
1917987Speter
201556SrgrimesLFLAGS= -8	# 8-bit lex scanner for arithmetic
211556SrgrimesCFLAGS+=-DSHELL -I. -I${.CURDIR}
2217988Speter# for debug:
2317988Speter# CFLAGS+= -g -DDEBUG=2
2417987Speter
251556Srgrimes.PATH:	${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf
261556Srgrimes
2730113SjkhCLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
2835783Sbde	mksyntax mksyntax.o
2930113SjkhCLEANFILES+= ${GENSRCS} ${GENHDRS}
301556Srgrimes
3137456Sbdebuild-tools: mkinit mknodes mksyntax
3237456Sbde
3330113Sjkh.ORDER: builtins.c builtins.h
3425903Sstevebuiltins.c builtins.h: mkbuiltins builtins.def
3517987Speter	cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
361556Srgrimes
3725903Ssteveinit.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
3825903Ssteve	redir.c trap.c var.c
3917987Speter	./mkinit ${.ALLSRC:S/^mkinit$//}
401556Srgrimes
4128729Sbde# XXX this is just to stop the default .c rule being used, so that the
4228729Sbde# intermediate object has a fixed name.
4328729Sbde# XXX we have a default .c rule, but no default .o rule.
4428729Sbde.o:
4528729Sbde	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
4628729Sbdemkinit: mkinit.o
4728729Sbdemknodes: mknodes.o
4828729Sbdemksyntax: mksyntax.o
4928729Sbde
5030113Sjkh.ORDER: nodes.c nodes.h
5117987Speternodes.c nodes.h: mknodes nodetypes nodes.c.pat
521556Srgrimes	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
531556Srgrimes
5430113Sjkh.ORDER: syntax.c syntax.h
551556Srgrimessyntax.c syntax.h: mksyntax
561556Srgrimes	./mksyntax
571556Srgrimes
5825903Sstevetoken.h: mktokens
5925903Ssteve	sh ${.CURDIR}/mktokens
601556Srgrimes
611556Srgrimes.include <bsd.prog.mk>
62