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