1# @(#)Makefile 8.4 (Berkeley) 5/5/95 2# $FreeBSD: src/bin/sh/Makefile,v 1.30.2.1 2001/12/15 10:05:18 knu Exp $ 3# $DragonFly: src/bin/sh/Makefile,v 1.3 2004/03/22 20:57:25 dillon Exp $ 4 5PROG= sh 6SHSRCS= alias.c arith.y arith_lex.l cd.c echo.c error.c eval.c exec.c expand.c \ 7 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \ 8 mystring.c options.c output.c parser.c printf.c redir.c show.c \ 9 test.c trap.c var.c 10GENSRCS= builtins.c init.c nodes.c syntax.c 11GENHDRS= builtins.h nodes.h syntax.h token.h y.tab.h 12SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} y.tab.h 13 14# MLINKS for Shell built in commands for which there are no userland 15# utilities of the same name are handled with the associated manpage, 16# builtin.1 in share/man/man1/. 17 18DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP} 19LDADD+= -ll -ledit -ltermcap 20 21LFLAGS= -8 # 8-bit lex scanner for arithmetic 22CFLAGS+=-DSHELL -I. -I${.CURDIR} 23# for debug: 24# CFLAGS+= -g -DDEBUG=2 25 26.PATH: ${.CURDIR}/bltin \ 27 ${.CURDIR}/../../usr.bin/printf \ 28 ${.CURDIR}/../../bin/test 29 30CLEANFILES+= mkinit.nx mkinit.no mknodes.nx mknodes.no \ 31 mksyntax.nx mksyntax.no 32CLEANFILES+= ${GENSRCS} ${GENHDRS} 33 34build-tools: mkinit.nx mknodes.nx mksyntax.nx 35 36.ORDER: builtins.c builtins.h 37builtins.c builtins.h: mkbuiltins builtins.def 38 cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR} 39 40init.c: mkinit.nx alias.c eval.c exec.c input.c jobs.c options.c parser.c \ 41 redir.c trap.c var.c 42 ./mkinit.nx ${.ALLSRC:S/^mkinit.nx$//} 43 44# XXX this is just to stop the default .c rule being used, so that the 45# intermediate object has a fixed name. 46# XXX we have a default .c rule, but no default .o rule. 47.o: 48 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} 49mkinit.nx: mkinit.no 50mknodes.nx: mknodes.no 51mksyntax.nx: mksyntax.no 52 53.ORDER: nodes.c nodes.h 54nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat 55 ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat 56 57.ORDER: syntax.c syntax.h 58syntax.c syntax.h: mksyntax.nx 59 ./mksyntax.nx 60 61token.h: mktokens 62 sh ${.CURDIR}/mktokens 63 64.include <bsd.prog.mk> 65