1 # @(#)Makefile 8.4 (Berkeley) 5/5/95
5 SHSRCS= alias.c arith.y arith_lex.l 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 output.c parser.c redir.c show.c \
9 GENSRCS= builtins.c init.c nodes.c syntax.c
10 GENHDRS= builtins.h nodes.h syntax.h token.h y.tab.h
11 SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} y.tab.h
13 # MLINKS for Shell built in commands for which there are no userland
14 # utilities of the same name are handled with the associated manpage,
15 # builtin.1 in share/man/man1/.
17 DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
18 LDADD+= -ll -ledit -ltermcap
20 LFLAGS= -8 # 8-bit lex scanner for arithmetic
21 CFLAGS+=-DSHELL -I. -I${.CURDIR}
23 # CFLAGS+= -g -DDEBUG=2
27 .PATH: ${.CURDIR}/bltin \
28 ${.CURDIR}/../../bin/test
30 CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
32 CLEANFILES+= ${GENSRCS} ${GENHDRS}
34 build-tools: mkinit mknodes mksyntax
36 .ORDER: builtins.c builtins.h
37 builtins.c builtins.h: mkbuiltins builtins.def
38 cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
40 init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
42 ./mkinit ${.ALLSRC:S/^mkinit$//}
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.
48 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
53 .ORDER: nodes.c nodes.h
54 nodes.c nodes.h: mknodes nodetypes nodes.c.pat
55 ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
57 .ORDER: syntax.c syntax.h
58 syntax.c syntax.h: mksyntax
62 sh ${.CURDIR}/mktokens
64 .include <bsd.prog.mk>