1 # $NetBSD: Makefile,v 1.87 2009/12/07 16:22:41 uebayasi Exp $ 2 # @(#)Makefile 8.4 (Berkeley) 5/5/95 3 4 .include <bsd.own.mk> 5 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} 15 16 DPSRCS+=${GENHDRS} 17 18 LDADD+= -ll -ledit -ltermcap 19 DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP} 20 21 LFLAGS= -8 # 8-bit lex scanner for arithmetic 22 YFLAGS= -d 23 24 # Environment for scripts executed during build. 25 SCRIPT_ENV= \ 26 AWK=${TOOL_AWK:Q} \ 27 SED=${TOOL_SED:Q} 28 29 # The .depend file can get references to these temporary files 30 .OPTIONAL: lex.yy.c y.tab.c 31 32 .ifdef CRUNCHEDPROG 33 LFLAGS+=-L 34 YFLAGS+=-l 35 .endif 36 37 CPPFLAGS+=-DSHELL -I. -I${.CURDIR} 38 #XXX: For testing only. 39 #CPPFLAGS+=-DDEBUG=1 40 #CFLAGS+=-funsigned-char 41 #TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char 42 43 .ifdef SMALLPROG 44 CPPFLAGS+=-DSMALL 45 .else 46 SRCS+=printf.c 47 .endif 48 49 .PATH: ${.CURDIR}/bltin ${NETBSDSRCDIR}/bin/test \ 50 ${NETBSDSRCDIR}/usr.bin/printf \ 51 ${NETBSDSRCDIR}/bin/kill 52 53 CLEANFILES+= ${GENSRCS} ${GENHDRS} y.tab.h 54 CLEANFILES+= trace 55 56 token.h: mktokens 57 ${_MKTARGET_CREATE} 58 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} 59 60 builtins.h: builtins.c 61 ${_MKTARGET_CREATE} 62 63 builtins.c: mkbuiltins shell.h builtins.def 64 ${_MKTARGET_CREATE} 65 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR} 66 [ -f builtins.h ] 67 68 init.c: mkinit.sh ${SHSRCS} 69 ${_MKTARGET_CREATE} 70 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} 71 72 nodes.h: nodes.c 73 74 nodes.c: mknodes.sh nodetypes nodes.c.pat 75 ${_MKTARGET_CREATE} 76 ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR} 77 [ -f nodes.h ] 78 79 arith.h: arith.c 80 arith.c: arith.y 81 82 .if ${USETOOLS} == "yes" 83 COMPATOBJDIR!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR} 84 NBCOMPATLIB= -L${COMPATOBJDIR} -lnbcompat 85 .endif 86 87 .include <bsd.prog.mk> 88