1# @(#)Makefile 8.4 (Berkeley) 5/5/95 2# $FreeBSD$ 3 4PROG= sh 5INSTALLFLAGS= -S 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 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# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline 25WARNS?= 2 26WFORMAT=0 27 28.PATH: ${.CURDIR}/bltin \ 29 ${.CURDIR}/../test \ 30 ${.CURDIR}/../../usr.bin/printf 31 32CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \ 33 mksyntax mksyntax.o 34CLEANFILES+= ${GENSRCS} ${GENHDRS} 35 36build-tools: mkinit mknodes mksyntax 37 38.ORDER: builtins.c builtins.h 39builtins.c builtins.h: mkbuiltins builtins.def 40 cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR} 41 42init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \ 43 redir.c trap.c var.c 44 ./mkinit ${.ALLSRC:S/^mkinit$//} 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: mkinit.o 52mknodes: mknodes.o 53mksyntax: mksyntax.o 54 55.ORDER: nodes.c nodes.h 56nodes.c nodes.h: mknodes nodetypes nodes.c.pat 57 ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat 58 59.ORDER: syntax.c syntax.h 60syntax.c syntax.h: mksyntax 61 ./mksyntax 62 63token.h: mktokens 64 sh ${.CURDIR}/mktokens 65 66regress: 67 cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh 68 69.include <bsd.prog.mk> 70