etc/protocols - sync with NetBSD-8
[minix.git] / bin / sh / Makefile
blobe4470d3a3345867b8097957e600641e3a8790771
1 # $NetBSD: Makefile,v 1.101 2015/05/10 20:30:54 joerg Exp $
2 # @(#)Makefile 8.4 (Berkeley) 5/5/95
4 .include <bsd.own.mk>
6 YHEADER=1
7 PROG= sh
8 SHSRCS= 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 kill.c syntax.c
12 GENSRCS=arith.c arith_lex.c builtins.c init.c nodes.c
13 GENHDRS=arith.h builtins.h nodes.h token.h
14 SRCS= ${SHSRCS} ${GENSRCS}
16 DPSRCS+=${GENHDRS}
18 LDADD+= -ll -ledit -lterminfo
19 DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMINFO}
21 LFLAGS= -8 # 8-bit lex scanner for arithmetic
23 # Environment for scripts executed during build.
24 SCRIPT_ENV= \
25 AWK=${TOOL_AWK:Q} \
26 SED=${TOOL_SED:Q}
28 # The .depend file can get references to these temporary files
29 .OPTIONAL: lex.yy.c y.tab.c
31 .ifdef CRUNCHEDPROG
32 LFLAGS+=-L
33 YFLAGS+=-l
34 .endif
36 CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
37 #XXX: For testing only.
38 #CPPFLAGS+=-DDEBUG=2
39 #COPTS+=-g
40 #CFLAGS+=-funsigned-char
41 #TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char
43 .ifdef SMALLPROG
44 CPPFLAGS+=-DSMALL
45 .endif
46 .ifdef TINYPROG
47 CPPFLAGS+=-DTINY
48 .else
49 SRCS+=printf.c
50 .endif
52 .PATH: ${.CURDIR}/bltin ${NETBSDSRCDIR}/bin/test \
53 ${NETBSDSRCDIR}/usr.bin/printf \
54 ${NETBSDSRCDIR}/bin/kill
56 CLEANFILES+= ${GENSRCS} ${GENHDRS} y.tab.h
57 CLEANFILES+= trace
59 token.h: mktokens
60 ${_MKTARGET_CREATE}
61 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC}
63 .ORDER: builtins.h builtins.c
64 builtins.h builtins.c: mkbuiltins shell.h builtins.def
65 ${_MKTARGET_CREATE}
66 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR}
67 [ -f builtins.h ]
69 init.c: mkinit.sh ${SHSRCS}
70 ${_MKTARGET_CREATE}
71 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC}
73 .ORDER: nodes.h nodes.c
74 nodes.c nodes.h: mknodes.sh nodetypes nodes.c.pat
75 ${_MKTARGET_CREATE}
76 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR}
77 [ -f nodes.h ]
79 .if ${USETOOLS} == "yes"
80 NBCOMPATLIB= -L${TOOLDIR}/lib -lnbcompat
81 .endif
83 .if !defined(__MINIX)
84 SUBDIR+=USD.doc
85 .endif # !defined(__MINIX)
87 COPTS.printf.c = -Wno-format-nonliteral
88 COPTS.jobs.c = -Wno-format-nonliteral
90 .include <bsd.prog.mk>
91 .include <bsd.subdir.mk>