xref: /netbsd/bin/sh/Makefile (revision bf9ec67e)
1#	$NetBSD: Makefile,v 1.57 2002/05/15 20:45:17 bjh21 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.ifdef SMALLPROG
25CPPFLAGS+=-DSMALL
26.endif
27
28.PATH:	${.CURDIR}/bltin ${.CURDIR}/../test
29
30CLEANFILES+= mkinit mknodes mksyntax
31CLEANFILES+= ${GENSRCS} y.tab.h
32
33token.h: mktokens
34	sh ${.ALLSRC}
35
36builtins.c builtins.h: mkbuiltins shell.h builtins.def
37	sh ${.ALLSRC} ${.OBJDIR}
38
39init.c: mkinit ${SHSRCS}
40	./${.ALLSRC}
41
42nodes.c nodes.h: mknodes nodetypes nodes.c.pat
43	./${.ALLSRC}
44
45syntax.c syntax.h: mksyntax
46	./${.ALLSRC}
47
48mkinit: mkinit.c
49	${HOST_LINK.c} -o mkinit ${.IMPSRC}
50
51mknodes: mknodes.c
52	${HOST_LINK.c} -o mknodes ${.IMPSRC}
53
54.if	(${MACHINE_ARCH} == "powerpc") || \
55	(${MACHINE_CPU} == "arm")
56TARGET_CHARFLAG= -DTARGET_CHAR="u_int8_t"
57.else
58TARGET_CHARFLAG= -DTARGET_CHAR="int8_t"
59.endif
60
61mksyntax: mksyntax.c
62	${HOST_LINK.c} ${TARGET_CHARFLAG} -o mksyntax ${.IMPSRC}
63
64.include <bsd.prog.mk>
65
66${OBJS}: builtins.h nodes.h syntax.h token.h
67