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