Makefile revision 50476
117987Speter#	@(#)Makefile	8.4 (Berkeley) 5/5/95
250471Speter# $FreeBSD: head/bin/sh/Makefile 50471 1999-08-27 23:15:48Z peter $
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
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 \
2435783Sbde	mksyntax mksyntax.o
2530113SjkhCLEANFILES+= ${GENSRCS} ${GENHDRS}
261556Srgrimes
2737456Sbdebuild-tools: mkinit mknodes mksyntax
2837456Sbde
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
4328729Sbdemknodes: mknodes.o
4428729Sbdemksyntax: mksyntax.o
4528729Sbde
4630113Sjkh.ORDER: nodes.c nodes.h
4717987Speternodes.c nodes.h: mknodes nodetypes nodes.c.pat
481556Srgrimes	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
491556Srgrimes
5030113Sjkh.ORDER: syntax.c syntax.h
511556Srgrimessyntax.c syntax.h: mksyntax
521556Srgrimes	./mksyntax
531556Srgrimes
5425903Sstevetoken.h: mktokens
5525903Ssteve	sh ${.CURDIR}/mktokens
561556Srgrimes
571556Srgrimes.include <bsd.prog.mk>
58