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