1 # $NetBSD: Makefile,v 1.78 2004/06/06 07:03:11 christos 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 # The .depend file can get references to these temporary files 25 .OPTIONAL: lex.yy.c y.tab.c 26 27 .ifdef CRUNCHEDPROG 28 LFLAGS+=-L 29 YFLAGS+=-l 30 .endif 31 32 CPPFLAGS+=-DSHELL -I. -I${.CURDIR} 33 #XXX: For testing only. 34 #CPPFLAGS+=-DDEBUG=1 35 #CFLAGS+=-funsigned-char 36 #TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char 37 38 .ifdef SMALLPROG 39 CPPFLAGS+=-DSMALL 40 .else 41 SRCS+=printf.c 42 .endif 43 44 .PATH: ${.CURDIR}/bltin ${NETBSDSRCDIR}/bin/test \ 45 ${NETBSDSRCDIR}/usr.bin/printf \ 46 ${NETBSDSRCDIR}/bin/kill 47 48 CLEANFILES+= ${GENSRCS} ${GENHDRS} y.tab.h 49 CLEANFILES+= trace 50 51 token.h: mktokens 52 ${_MKTARGET_CREATE} 53 ${HOST_SH} ${.ALLSRC} 54 55 builtins.h: builtins.c 56 ${_MKTARGET_CREATE} 57 58 builtins.c: mkbuiltins shell.h builtins.def 59 ${_MKTARGET_CREATE} 60 ${HOST_SH} ${.ALLSRC} ${.OBJDIR} 61 [ -f builtins.h ] 62 63 init.c: mkinit.sh ${SHSRCS} 64 ${_MKTARGET_CREATE} 65 ${HOST_SH} ${.ALLSRC} 66 67 nodes.h: nodes.c 68 69 nodes.c: mknodes.sh nodetypes nodes.c.pat 70 ${_MKTARGET_CREATE} 71 ${HOST_SH} ${.ALLSRC} ${.OBJDIR} 72 [ -f nodes.h ] 73 74 .if ${USETOOLS} == "yes" 75 COMPATOBJDIR!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR} 76 NBCOMPATLIB= -L${COMPATOBJDIR} -lnbcompat 77 .endif 78 79 .include <bsd.prog.mk> 80