Home | History | Annotate | Line # | Download | only in sh
Makefile revision 1.88
      1 #	$NetBSD: Makefile,v 1.88 2009/12/11 08:39:42 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 	${GENCMD} ${.TARGET} \
     59 	${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC}
     60 
     61 builtins.c builtins.h: mkbuiltins shell.h builtins.def
     62 	${_MKTARGET_CREATE}
     63 	${GENCMD} ${.TARGET} \
     64 	${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} .
     65 
     66 init.c: mkinit.sh ${SHSRCS}
     67 	${_MKTARGET_CREATE}
     68 	${GENCMD} ${.TARGET} \
     69 	${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC}
     70 
     71 nodes.c nodes.h: mknodes.sh nodetypes nodes.c.pat
     72 	${_MKTARGET_CREATE}
     73 	${GENCMD} ${.TARGET} \
     74 	${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} .
     75 
     76 arith.c arith.h: arith.y
     77 	${_MKTARGET_CREATE}
     78 	${GENCMD} y.tab.${.TARGET:T:E} \
     79 	${YACC.y} ${.ALLSRC}
     80 
     81 .if ${USETOOLS} == "yes"
     82 COMPATOBJDIR!=	cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
     83 NBCOMPATLIB=	-L${COMPATOBJDIR} -lnbcompat
     84 .endif
     85 
     86 .include <bsd.prog.mk>
     87 
     88 # override
     89 .y.c:
     90 .y.h:
     91