1 # $NetBSD: Makefile,v 1.50 2000/04/09 23:27:03 christos Exp $ 2 # @(#)Makefile 8.4 (Berkeley) 5/5/95 3 4 WARNS=2 5 YHEADER=1 6 PROG= sh 7 SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \ 8 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \ 9 mystring.c options.c parser.c redir.c show.c trap.c output.c var.c \ 10 test.c 11 GENSRCS=arith.c arith.h arith_lex.c builtins.c builtins.h init.c nodes.c \ 12 nodes.h syntax.c syntax.h token.h 13 SRCS= ${SHSRCS} ${GENSRCS} 14 15 LDADD+= -ll -ledit -ltermcap 16 DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP} 17 18 LFLAGS= -8 # 8-bit lex scanner for arithmetic 19 YFLAGS= -d 20 21 CPPFLAGS+=-DSHELL -I. -I${.CURDIR} 22 23 .PATH: ${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf ${.CURDIR}/../test 24 25 CLEANFILES+= mkinit mknodes mksyntax 26 CLEANFILES+= ${GENSRCS} y.tab.h 27 28 token.h: mktokens 29 sh ${.ALLSRC} 30 31 builtins.c builtins.h: mkbuiltins shell.h builtins.def 32 sh ${.ALLSRC} ${.OBJDIR} 33 34 init.c: mkinit ${SHSRCS} 35 ./${.ALLSRC} 36 37 nodes.c nodes.h: mknodes nodetypes nodes.c.pat 38 ./${.ALLSRC} 39 40 syntax.c syntax.h: mksyntax 41 ./${.ALLSRC} 42 43 mkinit: mkinit.c 44 ${HOST_LINK.c} -o mkinit ${.IMPSRC} 45 46 mknodes: mknodes.c 47 ${HOST_LINK.c} -o mknodes ${.IMPSRC} 48 49 .if (${MACHINE_ARCH} == "powerpc") || \ 50 (${MACHINE_ARCH} == "arm32") 51 TARGET_CHARFLAG= -DTARGET_CHAR="u_int8_t" 52 .else 53 TARGET_CHARFLAG= -DTARGET_CHAR="int8_t" 54 .endif 55 56 mksyntax: mksyntax.c 57 ${HOST_LINK.c} ${TARGET_CHARFLAG} -o mksyntax ${.IMPSRC} 58 59 .include <bsd.prog.mk> 60 61 ${OBJS}: builtins.h nodes.h syntax.h token.h 62