Home | History | Annotate | Line # | Download | only in sh
Makefile revision 1.63
      1 #	$NetBSD: Makefile,v 1.63 2003/01/22 20:36:03 dsl 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 printf.c kill.c
     12 GENSRCS=arith.c arith.h arith_lex.c builtins.c builtins.h init.c nodes.c \
     13 	nodes.h syntax.c syntax.h token.h
     14 SRCS=	${SHSRCS} ${GENSRCS}
     15 
     16 LDADD+=	-ll -ledit -ltermcap
     17 DPADD+=	${LIBL} ${LIBEDIT} ${LIBTERMCAP}
     18 
     19 LFLAGS= -8	# 8-bit lex scanner for arithmetic
     20 YFLAGS=	-d
     21 
     22 CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
     23 #XXX: For testing only.
     24 #CPPFLAGS+=-DDEBUG=1
     25 #CFLAGS+=-funsigned-char
     26 #TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char
     27 
     28 .ifdef SMALLPROG
     29 CPPFLAGS+=-DSMALL
     30 .endif
     31 
     32 .PATH:	${.CURDIR}/bltin ${NETBSDSRCDIR}/bin/test \
     33 	${NETBSDSRCDIR}/usr.bin/printf \
     34 	${NETBSDSRCDIR}/bin/kill
     35 
     36 CLEANFILES+= mkinit mknodes mksyntax
     37 CLEANFILES+= ${GENSRCS} y.tab.h
     38 
     39 token.h: mktokens
     40 	sh ${.ALLSRC}
     41 
     42 builtins.c builtins.h: mkbuiltins shell.h builtins.def
     43 	sh ${.ALLSRC} ${.OBJDIR}
     44 
     45 init.c: mkinit ${SHSRCS}
     46 	./${.ALLSRC}
     47 
     48 nodes.c nodes.h: mknodes nodetypes nodes.c.pat
     49 	./${.ALLSRC}
     50 
     51 syntax.c syntax.h: mksyntax
     52 	./${.ALLSRC}
     53 
     54 mkinit: mkinit.c
     55 	${HOST_LINK.c} -o mkinit ${.IMPSRC}
     56 
     57 mknodes: mknodes.c
     58 	${HOST_LINK.c} -o mknodes ${.IMPSRC}
     59 
     60 .if	(${MACHINE_ARCH} == "powerpc") || \
     61 	(${MACHINE_CPU} == "arm")
     62 TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char"
     63 .else
     64 TARGET_CHARFLAG?= -DTARGET_CHAR="signed char"
     65 .endif
     66 
     67 mksyntax: mksyntax.c
     68 	${HOST_LINK.c} ${TARGET_CHARFLAG} -o mksyntax ${.IMPSRC}
     69 
     70 .include <bsd.prog.mk>
     71 
     72 ${OBJS}: builtins.h nodes.h syntax.h token.h
     73