Makefile revision 233294
1142425Snectar#	@(#)Makefile	8.4 (Berkeley) 5/5/95
2160814Ssimon# $FreeBSD: head/bin/sh/Makefile 218466 2011-02-08 23:18:06Z jilles $
3142425Snectar
4142425SnectarPROG=	sh
5142425SnectarINSTALLFLAGS= -S
6142425SnectarSHSRCS=	alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
7142425Snectar	exec.c expand.c \
8142425Snectar	histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
9142425Snectar	mystring.c options.c output.c parser.c printf.c redir.c show.c \
10142425Snectar	test.c trap.c var.c
11142425SnectarGENSRCS= builtins.c init.c nodes.c syntax.c
12142425SnectarGENHDRS= builtins.h nodes.h syntax.h token.h
13142425SnectarSRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
14142425Snectar
15142425Snectar# MLINKS for Shell built in commands for which there are no userland
16142425Snectar# utilities of the same name are handled with the associated manpage,
17142425Snectar# builtin.1 in share/man/man1/.
18142425Snectar
19142425SnectarDPADD= ${LIBEDIT} ${LIBTERMCAP}
20142425SnectarLDADD= -ledit -ltermcap
21142425Snectar
22142425SnectarCFLAGS+=-DSHELL -I. -I${.CURDIR}
23142425Snectar# for debug:
24142425Snectar# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
25142425SnectarWARNS?=	2
26142425SnectarWFORMAT=0
27142425Snectar
28142425Snectar.PATH:	${.CURDIR}/bltin \
29142425Snectar	${.CURDIR}/../kill \
30142425Snectar	${.CURDIR}/../test \
31142425Snectar	${.CURDIR}/../../usr.bin/printf
32142425Snectar
33142425SnectarCLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
34142425Snectar	mksyntax mksyntax.o
35142425SnectarCLEANFILES+= ${GENSRCS} ${GENHDRS}
36238405Sjkim
37142425Snectarbuild-tools: mkinit mknodes mksyntax
38142425Snectar
39142425Snectar.ORDER: builtins.c builtins.h
40142425Snectarbuiltins.c builtins.h: mkbuiltins builtins.def
41142425Snectar	cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
42142425Snectar
43142425Snectarinit.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
44142425Snectar	redir.c trap.c var.c
45142425Snectar	./mkinit ${.ALLSRC:S/^mkinit$//}
46142425Snectar
47142425Snectar# XXX this is just to stop the default .c rule being used, so that the
48142425Snectar# intermediate object has a fixed name.
49160814Ssimon# XXX we have a default .c rule, but no default .o rule.
50160814Ssimon.o:
51142425Snectar	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
52142425Snectarmkinit: mkinit.o
53142425Snectarmknodes: mknodes.o
54142425Snectarmksyntax: mksyntax.o
55142425Snectar
56142425Snectar.ORDER: nodes.c nodes.h
57142425Snectarnodes.c nodes.h: mknodes nodetypes nodes.c.pat
58142425Snectar	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
59142425Snectar
60142425Snectar.ORDER: syntax.c syntax.h
61142425Snectarsyntax.c syntax.h: mksyntax
62142425Snectar	./mksyntax
63142425Snectar
64284285Sjkimtoken.h: mktokens
65284285Sjkim	sh ${.CURDIR}/mktokens
66142425Snectar
67160814Ssimonregress:
68142425Snectar	cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
69142425Snectar
70142425Snectar.include <bsd.prog.mk>
71142425Snectar