1# @(#)Makefile 8.4 (Berkeley) 5/5/95 2# $Id$ 3 4PROG= sh 5SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \ 6 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \ 7 mystring.c options.c parser.c printf.c redir.c show.c \ 8 trap.c output.c var.c 9 10GENSRCS=arith.c arith_lex.c builtins.c init.c nodes.c syntax.c 11 12SRCS= ${GENSRCS} ${SHSRCS} 13 14DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP} 15LDADD+= -ll -ledit -ltermcap 16 17LFLAGS= -8 # 8-bit lex scanner for arithmetic 18CFLAGS+=-DSHELL -I. -I${.CURDIR} 19# for debug: 20# CFLAGS+= -g -DDEBUG=2 21 22.PATH: ${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf 23 24CLEANFILES+= builtins.h mkinit mkinit.o mknodes mknodes.o \ 25 mksyntax mksyntax.o \ 26 nodes.h syntax.h token.h y.tab.h 27CLEANFILES+= ${GENSRCS} 28 29beforedepend: token.h 30 31builtins.h builtins.c: mkbuiltins builtins.def 32 cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR} 33 34init.c: mkinit ${SHSRCS} 35 ./mkinit ${.ALLSRC:S/^mkinit$//} 36 37# XXX this is just to stop the default .c rule being used, so that the 38# intermediate object has a fixed name. 39# XXX we have a default .c rule, but no default .o rule. 40.o: 41 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} 42mkinit: mkinit.o 43mkinit.o: mkinit.c # XXX and many headers 44mknodes: mknodes.o 45mknodes.o: mknodes.c # XXX and many headers 46mksyntax: mksyntax.o 47mksyntax.o: mksyntax.c # XXX and many headers 48 49nodes.c nodes.h: mknodes nodetypes nodes.c.pat 50 ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat 51 52parser.o: token.h 53 54syntax.c syntax.h: mksyntax 55 ./mksyntax 56 57token.h: mktokens 58 sh ${.CURDIR}/mktokens 59 60.include <bsd.prog.mk> 61