Makefile revision 1.27
1#	$NetBSD: Makefile,v 1.27 1997/05/06 20:44:59 gwr 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# echo.c
24.PATH.c: ${.CURDIR}/bltin
25# printf.c
26.PATH.c: ${.CURDIR}/../../usr.bin/printf
27
28CLEANFILES+= builtins.h mkinit mknodes mksyntax \
29	nodes.h syntax.h token.h y.tab.h
30CLEANFILES+= ${GENSRCS}
31
32beforedepend: token.h
33
34token.h: mktokens
35	sh ${.CURDIR}/mktokens
36
37builtins.h builtins.c: mkbuiltins builtins.def
38	cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
39
40init.c: mkinit ${SHSRCS}
41	./mkinit ${.ALLSRC:S/^mkinit$//}
42
43nodes.c nodes.h: mknodes nodetypes nodes.c.pat
44	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
45
46syntax.c syntax.h: mksyntax
47	./mksyntax
48
49parser.o: token.h
50
51mkinit: mkinit.c
52	${HOST_COMPILE.c} ${.CURDIR}/mkinit.c
53	${HOST_LINK.c} -o ${.TARGET} mkinit.o
54
55mknodes: mknodes.c
56	${HOST_COMPILE.c} ${.CURDIR}/mknodes.c
57	${HOST_LINK.c} -o ${.TARGET} mknodes.o
58
59mksyntax: mksyntax.c
60	${HOST_COMPILE.c} ${.CURDIR}/mksyntax.c
61	${HOST_LINK.c} -o ${.TARGET} mksyntax.o
62
63.include <bsd.prog.mk>
64
65${OBJS}: builtins.h nodes.h syntax.h
66