Home | History | Annotate | Line # | Download | only in sh
Makefile revision 1.99
      1 #	$NetBSD: Makefile,v 1.99 2012/12/02 12:55:27 apb 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=2
     39 #COPTS+=-g
     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 .ORDER: builtins.h builtins.c
     61 builtins.h builtins.c: mkbuiltins shell.h builtins.def
     62 	${_MKTARGET_CREATE}
     63 	${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR}
     64 	[ -f builtins.h ]
     65 
     66 init.c: mkinit.sh ${SHSRCS}
     67 	${_MKTARGET_CREATE}
     68 	${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC}
     69 
     70 .ORDER: nodes.h nodes.c
     71 nodes.c nodes.h: mknodes.sh nodetypes nodes.c.pat
     72 	${_MKTARGET_CREATE}
     73 	${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR}
     74 	[ -f nodes.h ]
     75 
     76 .if ${USETOOLS} == "yes"
     77 NBCOMPATLIB=   -L${TOOLDIR}/lib -lnbcompat
     78 .endif
     79 
     80 .if make(install)
     81 SUBDIR+=USD.doc
     82 .endif
     83 
     84 COPTS.printf.c = -Wno-format-nonliteral
     85 COPTS.jobs.c = -Wno-format-nonliteral
     86 
     87 .include <bsd.prog.mk>
     88 .include <bsd.subdir.mk>
     89