Makefile revision 297997
117987Speter#	@(#)Makefile	8.4 (Berkeley) 5/5/95
250471Speter# $FreeBSD: head/bin/sh/Makefile 297997 2016-04-14 21:06:10Z bdrewery $
31556Srgrimes
4265420Simp.include <src.opts.mk>
5259210Sjmmv
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
21275028SbaptLIBADD=	edit
2217987Speter
231556SrgrimesCFLAGS+=-DSHELL -I. -I${.CURDIR}
2417988Speter# for debug:
25213811Sobrien# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
26173718SjbWARNS?=	2
27114500SobrienWFORMAT=0
2817987Speter
2986505Sknu.PATH:	${.CURDIR}/bltin \
30216629Sjilles	${.CURDIR}/../kill \
31215520Sjilles	${.CURDIR}/../test \
32215520Sjilles	${.CURDIR}/../../usr.bin/printf
331556Srgrimes
34253650SjillesCLEANFILES+= mknodes mknodes.o \
3535783Sbde	mksyntax mksyntax.o
3630113SjkhCLEANFILES+= ${GENSRCS} ${GENHDRS}
371556Srgrimes
38253650Sjillesbuild-tools: mknodes mksyntax
3937456Sbde
4030113Sjkh.ORDER: builtins.c builtins.h
4125903Sstevebuiltins.c builtins.h: mkbuiltins builtins.def
42235927Smarcel	sh ${.CURDIR}/mkbuiltins ${.CURDIR}
431556Srgrimes
4428729Sbde# XXX this is just to stop the default .c rule being used, so that the
4528729Sbde# intermediate object has a fixed name.
4628729Sbde# XXX we have a default .c rule, but no default .o rule.
47297997Sbdrewerymknodes.o mksyntax.o: ${BUILD_TOOLS_META}
4828729Sbde	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
49297997Sbdrewerymknodes: mknodes.o ${BUILD_TOOLS_META}
50297997Sbdrewerymksyntax: mksyntax.o ${BUILD_TOOLS_META}
5128729Sbde
5230113Sjkh.ORDER: nodes.c nodes.h
5317987Speternodes.c nodes.h: mknodes nodetypes nodes.c.pat
541556Srgrimes	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
551556Srgrimes
5630113Sjkh.ORDER: syntax.c syntax.h
571556Srgrimessyntax.c syntax.h: mksyntax
581556Srgrimes	./mksyntax
591556Srgrimes
6025903Sstevetoken.h: mktokens
6125903Ssteve	sh ${.CURDIR}/mktokens
621556Srgrimes
63259210Sjmmv.if ${MK_TESTS} != "no"
64259210SjmmvSUBDIR+=    tests
65259210Sjmmv.endif
66213738Sobrien
671556Srgrimes.include <bsd.prog.mk>
68