Makefile revision 225736
11556Srgrimes#	@(#)Makefile	8.4 (Berkeley) 5/5/95
21556Srgrimes# $FreeBSD: stable/9/bin/sh/Makefile 218466 2011-02-08 23:18:06Z jilles $
31556Srgrimes
41556SrgrimesPROG=	sh
51556SrgrimesINSTALLFLAGS= -S
61556SrgrimesSHSRCS=	alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
71556Srgrimes	exec.c expand.c \
81556Srgrimes	histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
91556Srgrimes	mystring.c options.c output.c parser.c printf.c redir.c show.c \
101556Srgrimes	test.c trap.c var.c
111556SrgrimesGENSRCS= builtins.c init.c nodes.c syntax.c
121556SrgrimesGENHDRS= builtins.h nodes.h syntax.h token.h
131556SrgrimesSRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
141556Srgrimes
151556Srgrimes# MLINKS for Shell built in commands for which there are no userland
161556Srgrimes# utilities of the same name are handled with the associated manpage,
171556Srgrimes# builtin.1 in share/man/man1/.
181556Srgrimes
191556SrgrimesDPADD= ${LIBEDIT} ${LIBTERMCAP}
201556SrgrimesLDADD= -ledit -ltermcap
211556Srgrimes
221556SrgrimesCFLAGS+=-DSHELL -I. -I${.CURDIR}
231556Srgrimes# for debug:
241556Srgrimes# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
251556SrgrimesWARNS?=	2
261556SrgrimesWFORMAT=0
271556Srgrimes
281556Srgrimes.PATH:	${.CURDIR}/bltin \
291556Srgrimes	${.CURDIR}/../kill \
301556Srgrimes	${.CURDIR}/../test \
311556Srgrimes	${.CURDIR}/../../usr.bin/printf
3217987Speter
3350471SpeterCLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
341556Srgrimes	mksyntax mksyntax.o
351556SrgrimesCLEANFILES+= ${GENSRCS} ${GENHDRS}
361556Srgrimes
371556Srgrimesbuild-tools: mkinit mknodes mksyntax
381556Srgrimes
391556Srgrimes.ORDER: builtins.c builtins.h
401556Srgrimesbuiltins.c builtins.h: mkbuiltins builtins.def
411556Srgrimes	cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
421556Srgrimes
431556Srgrimesinit.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
441556Srgrimes	redir.c trap.c var.c
451556Srgrimes	./mkinit ${.ALLSRC:S/^mkinit$//}
461556Srgrimes
471556Srgrimes# XXX this is just to stop the default .c rule being used, so that the
481556Srgrimes# intermediate object has a fixed name.
491556Srgrimes# XXX we have a default .c rule, but no default .o rule.
501556Srgrimes.o:
511556Srgrimes	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
521556Srgrimesmkinit: mkinit.o
531556Srgrimesmknodes: mknodes.o
541556Srgrimesmksyntax: mksyntax.o
551556Srgrimes
561556Srgrimes.ORDER: nodes.c nodes.h
571556Srgrimesnodes.c nodes.h: mknodes nodetypes nodes.c.pat
5890111Simp	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
5990111Simp
6090111Simp.ORDER: syntax.c syntax.h
61200956Sjillessyntax.c syntax.h: mksyntax
6290111Simp	./mksyntax
63200956Sjilles
64108286Stjrtoken.h: mktokens
65	sh ${.CURDIR}/mktokens
66
67regress:
68	cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
69
70.include <bsd.prog.mk>
71