117987Speter#	@(#)Makefile	8.4 (Berkeley) 5/5/95
250471Speter# $FreeBSD$
31556Srgrimes
41556SrgrimesPROG=	sh
5127167SruINSTALLFLAGS= -S
6218466SjillesSHSRCS=	alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
7218466Sjilles	exec.c expand.c \
8216629Sjilles	histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
9215520Sjilles	mystring.c options.c output.c parser.c printf.c redir.c show.c \
1086505Sknu	test.c trap.c var.c
1135783SbdeGENSRCS= builtins.c init.c nodes.c syntax.c
12124751SruGENHDRS= builtins.h nodes.h syntax.h token.h
13218466SjillesSRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
1417987Speter
1551090Ssheldonh# MLINKS for Shell built in commands for which there are no userland
1651090Ssheldonh# utilities of the same name are handled with the associated manpage,
17157811Sschweikh# builtin.1 in share/man/man1/.
1851090Ssheldonh
19218466SjillesDPADD= ${LIBEDIT} ${LIBTERMCAP}
20218466SjillesLDADD= -ledit -ltermcap
2117987Speter
221556SrgrimesCFLAGS+=-DSHELL -I. -I${.CURDIR}
2317988Speter# for debug:
24213811Sobrien# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
25173718SjbWARNS?=	2
26114500SobrienWFORMAT=0
2717987Speter
2886505Sknu.PATH:	${.CURDIR}/bltin \
29216629Sjilles	${.CURDIR}/../kill \
30215520Sjilles	${.CURDIR}/../test \
31215520Sjilles	${.CURDIR}/../../usr.bin/printf
321556Srgrimes
3330113SjkhCLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
3435783Sbde	mksyntax mksyntax.o
3530113SjkhCLEANFILES+= ${GENSRCS} ${GENHDRS}
361556Srgrimes
3737456Sbdebuild-tools: mkinit mknodes mksyntax
3837456Sbde
3930113Sjkh.ORDER: builtins.c builtins.h
4025903Sstevebuiltins.c builtins.h: mkbuiltins builtins.def
4117987Speter	cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
421556Srgrimes
4325903Ssteveinit.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
4425903Ssteve	redir.c trap.c var.c
4517987Speter	./mkinit ${.ALLSRC:S/^mkinit$//}
461556Srgrimes
4728729Sbde# XXX this is just to stop the default .c rule being used, so that the
4828729Sbde# intermediate object has a fixed name.
4928729Sbde# XXX we have a default .c rule, but no default .o rule.
5028729Sbde.o:
5128729Sbde	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
5228729Sbdemkinit: mkinit.o
5328729Sbdemknodes: mknodes.o
5428729Sbdemksyntax: mksyntax.o
5528729Sbde
5630113Sjkh.ORDER: nodes.c nodes.h
5717987Speternodes.c nodes.h: mknodes nodetypes nodes.c.pat
581556Srgrimes	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
591556Srgrimes
6030113Sjkh.ORDER: syntax.c syntax.h
611556Srgrimessyntax.c syntax.h: mksyntax
621556Srgrimes	./mksyntax
631556Srgrimes
6425903Sstevetoken.h: mktokens
6525903Ssteve	sh ${.CURDIR}/mktokens
661556Srgrimes
67213738Sobrienregress:
68213738Sobrien	cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
69213738Sobrien
701556Srgrimes.include <bsd.prog.mk>
71