Makefile revision 1.26
1#	$NetBSD: Makefile,v 1.26 1997/04/17 08:13:26 thorpej Exp $
2#	@(#)Makefile	8.4 (Berkeley) 5/5/95
3
4PROG=	sh
5SHSRCS=	alias.c cd.c echo.c error.c eval.c exec.c expand.c \
6	histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
7	mystring.c options.c parser.c redir.c show.c trap.c output.c var.c
8GENSRCS= arith.c arith_lex.c builtins.c init.c nodes.c syntax.c
9SRCS= ${SHSRCS} ${GENSRCS}
10
11LDADD+=	-ll -ledit -ltermcap
12DPADD+=	${LIBL} ${LIBEDIT} ${LIBTERMCAP}
13
14LFLAGS= -8	# 8-bit lex scanner for arithmetic
15
16CFLAGS+=-DSHELL -I. -I${.CURDIR}
17
18# XXX
19.if (${MACHINE_ARCH} == "powerpc")
20CFLAGS+= -w
21.endif
22
23.PATH:	${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf
24
25CLEANFILES+= builtins.h mkinit mknodes mksyntax \
26	nodes.h syntax.h token.h y.tab.h
27CLEANFILES+= ${GENSRCS}
28
29beforedepend: token.h
30
31token.h: mktokens
32	sh ${.CURDIR}/mktokens
33
34builtins.h builtins.c: mkbuiltins builtins.def
35	cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
36
37init.c: mkinit ${SHSRCS}
38	./mkinit ${.ALLSRC:S/^mkinit$//}
39
40nodes.c nodes.h: mknodes nodetypes nodes.c.pat
41	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
42
43syntax.c syntax.h: mksyntax
44	./mksyntax
45
46parser.o: token.h
47
48mkinit: mkinit.c
49	${HOST_COMPILE.c} ${.CURDIR}/mkinit.c
50	${HOST_LINK.c} -o ${.TARGET} mkinit.o
51
52mknodes: mknodes.c
53	${HOST_COMPILE.c} ${.CURDIR}/mknodes.c
54	${HOST_LINK.c} -o ${.TARGET} mknodes.o
55
56mksyntax: mksyntax.c
57	${HOST_COMPILE.c} ${.CURDIR}/mksyntax.c
58	${HOST_LINK.c} -o ${.TARGET} mksyntax.o
59
60.include <bsd.prog.mk>
61
62${OBJS}: builtins.h nodes.h syntax.h
63