Makefile revision 30113
117987Speter#	@(#)Makefile	8.4 (Berkeley) 5/5/95
230113Sjkh#	$Id: Makefile,v 1.22 1997/08/25 19:50:01 bde Exp $
31556Srgrimes
41556SrgrimesPROG=	sh
517987SpeterSHSRCS=	alias.c 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
925221SsteveGENSRCS= arith.c arith_lex.c builtins.c init.c nodes.c syntax.c
1030113SjkhGENHDRS= builtins.h nodes.h syntax.h token.h
1130113SjkhSRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
1217987Speter
1325903SsteveDPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
1425221SsteveLDADD+= -ll -ledit -ltermcap
1517987Speter
161556SrgrimesLFLAGS= -8	# 8-bit lex scanner for arithmetic
171556SrgrimesCFLAGS+=-DSHELL -I. -I${.CURDIR}
1817988Speter# for debug:
1917988Speter# CFLAGS+= -g -DDEBUG=2
2017987Speter
211556Srgrimes.PATH:	${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf
221556Srgrimes
2330113SjkhCLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
2425221Ssteve	mksyntax mksyntax.o \
2530113Sjkh	y.tab.h
2630113SjkhCLEANFILES+= ${GENSRCS} ${GENHDRS}
271556Srgrimes
2813882Sjoerg
2930113Sjkh.ORDER: builtins.c builtins.h
3025903Sstevebuiltins.c builtins.h: mkbuiltins builtins.def
3117987Speter	cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
321556Srgrimes
3325903Ssteveinit.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
3425903Ssteve	redir.c trap.c var.c
3517987Speter	./mkinit ${.ALLSRC:S/^mkinit$//}
361556Srgrimes
3728729Sbde# XXX this is just to stop the default .c rule being used, so that the
3828729Sbde# intermediate object has a fixed name.
3928729Sbde# XXX we have a default .c rule, but no default .o rule.
4028729Sbde.o:
4128729Sbde	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
4228729Sbdemkinit: mkinit.o
4328729Sbdemkinit.o: mkinit.c		# XXX and many headers
4428729Sbdemknodes: mknodes.o
4528729Sbdemknodes.o: mknodes.c		# XXX and many headers
4628729Sbdemksyntax: mksyntax.o
4728729Sbdemksyntax.o: mksyntax.c		# XXX and many headers
4828729Sbde
4930113Sjkh.ORDER: nodes.c nodes.h
5017987Speternodes.c nodes.h: mknodes nodetypes nodes.c.pat
511556Srgrimes	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
521556Srgrimes
5330113Sjkh.ORDER: syntax.c syntax.h
541556Srgrimessyntax.c syntax.h: mksyntax
551556Srgrimes	./mksyntax
561556Srgrimes
5725903Sstevetoken.h: mktokens
5825903Ssteve	sh ${.CURDIR}/mktokens
591556Srgrimes
6025906Sstevey.tab.h: arith.c
6125906Ssteve
6225903Ssteve# Rules for object files that rely on generated headers.
6325960Sstevearith_lex.o: y.tab.h
6425903Sstevecd.o: nodes.h
6525903Ssteveeval.o: builtins.h nodes.h syntax.h
6625903Ssteveexec.o: builtins.h nodes.h syntax.h
6725903Ssteveexpand.o: nodes.h syntax.h
6825903Ssteveinput.o: syntax.h
6925903Sstevejobs.o: nodes.h syntax.h
7025903Sstevemain.o: nodes.h
7125903Sstevemystring.o: syntax.h
7225903Ssteveoptions.o: nodes.h
7325903Ssteveoutput.o: syntax.h
7425903Ssteveparser.o: nodes.h syntax.h token.h
7525903Ssteveredir.o: nodes.h
7625903Ssteveshow.o: nodes.h
7725903Sstevetrap.o: nodes.h syntax.h
7825903Sstevevar.o: nodes.h syntax.h
7925903Ssteve
801556Srgrimes.include <bsd.prog.mk>
81