117987Speter#	@(#)Makefile	8.4 (Berkeley) 5/5/95
250471Speter# $FreeBSD$
31556Srgrimes
4262951Sjmmv.include <bsd.own.mk>
5262951Sjmmv
61556SrgrimesPROG=	sh
7127167SruINSTALLFLAGS= -S
8218466SjillesSHSRCS=	alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
9218466Sjilles	exec.c expand.c \
10216629Sjilles	histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
11215520Sjilles	mystring.c options.c output.c parser.c printf.c redir.c show.c \
1286505Sknu	test.c trap.c var.c
13253650SjillesGENSRCS= builtins.c nodes.c syntax.c
14124751SruGENHDRS= builtins.h nodes.h syntax.h token.h
15218466SjillesSRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
1617987Speter
1751090Ssheldonh# MLINKS for Shell built in commands for which there are no userland
1851090Ssheldonh# utilities of the same name are handled with the associated manpage,
19157811Sschweikh# builtin.1 in share/man/man1/.
2051090Ssheldonh
21218466SjillesDPADD= ${LIBEDIT} ${LIBTERMCAP}
22218466SjillesLDADD= -ledit -ltermcap
2317987Speter
241556SrgrimesCFLAGS+=-DSHELL -I. -I${.CURDIR}
2517988Speter# for debug:
26213811Sobrien# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
27173718SjbWARNS?=	2
28114500SobrienWFORMAT=0
2917987Speter
3086505Sknu.PATH:	${.CURDIR}/bltin \
31216629Sjilles	${.CURDIR}/../kill \
32215520Sjilles	${.CURDIR}/../test \
33215520Sjilles	${.CURDIR}/../../usr.bin/printf
341556Srgrimes
35253650SjillesCLEANFILES+= mknodes mknodes.o \
3635783Sbde	mksyntax mksyntax.o
3730113SjkhCLEANFILES+= ${GENSRCS} ${GENHDRS}
381556Srgrimes
39253650Sjillesbuild-tools: mknodes mksyntax
4037456Sbde
4130113Sjkh.ORDER: builtins.c builtins.h
4225903Sstevebuiltins.c builtins.h: mkbuiltins builtins.def
43235927Smarcel	sh ${.CURDIR}/mkbuiltins ${.CURDIR}
441556Srgrimes
4528729Sbde# XXX this is just to stop the default .c rule being used, so that the
4628729Sbde# intermediate object has a fixed name.
4728729Sbde# XXX we have a default .c rule, but no default .o rule.
4828729Sbde.o:
4928729Sbde	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
5028729Sbdemknodes: mknodes.o
5128729Sbdemksyntax: mksyntax.o
5228729Sbde
5330113Sjkh.ORDER: nodes.c nodes.h
5417987Speternodes.c nodes.h: mknodes nodetypes nodes.c.pat
551556Srgrimes	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
561556Srgrimes
5730113Sjkh.ORDER: syntax.c syntax.h
581556Srgrimessyntax.c syntax.h: mksyntax
591556Srgrimes	./mksyntax
601556Srgrimes
6125903Sstevetoken.h: mktokens
6225903Ssteve	sh ${.CURDIR}/mktokens
631556Srgrimes
64262951Sjmmv.if ${MK_TESTS} != "no"
65262951SjmmvSUBDIR+=    tests
66262951Sjmmv.endif
67213738Sobrien
681556Srgrimes.include <bsd.prog.mk>
69