Merge branch 'vendor/BIND' into bind_vendor2
[dragonfly.git] / bin / sh / Makefile
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.7 2006/09/28 22:29:44 pavalos Exp $
4
5 PROG=   sh
6 SHSRCS= 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
10 GENSRCS= builtins.c init.c nodes.c syntax.c
11 GENHDRS= builtins.h nodes.h syntax.h token.h y.tab.h
12 SRCS= ${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
18 DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
19 LDADD+= -ll -ledit -ltermcap
20
21 LFLAGS= -8      # 8-bit lex scanner for arithmetic
22 CFLAGS+=-DSHELL -I. -I${.CURDIR}
23 # for debug:
24 # CFLAGS+= -g -DDEBUG=2
25
26 .if defined(BOOTSTRAPPING)
27 CFLAGS+= -DNO_HISTORY
28 .endif
29
30 .PATH:  ${.CURDIR}/bltin \
31         ${.CURDIR}/../../usr.bin/printf \
32         ${.CURDIR}/../../bin/test
33
34 CLEANFILES+= mkinit.nx mkinit.no mknodes.nx mknodes.no \
35         mksyntax.nx mksyntax.no
36 CLEANFILES+= ${GENSRCS} ${GENHDRS}
37
38 build-tools: mkinit.nx mknodes.nx mksyntax.nx
39
40 .ORDER: builtins.c builtins.h
41 builtins.c builtins.h: mkbuiltins builtins.def
42         cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
43
44 init.c: mkinit.nx alias.c eval.c exec.c input.c jobs.c options.c parser.c \
45         redir.c trap.c var.c
46         ./mkinit.nx ${.ALLSRC:S/^mkinit.nx$//}
47
48 # XXX this is just to stop the default .c rule being used, so that the
49 # intermediate object has a fixed name.
50 # XXX we have a default .c rule, but no default .o rule.
51 .o:
52         ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
53 mkinit.nx: mkinit.no
54 mknodes.nx: mknodes.no
55 mksyntax.nx: mksyntax.no
56
57 .ORDER: nodes.c nodes.h
58 nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat
59         ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
60
61 .ORDER: syntax.c syntax.h
62 syntax.c syntax.h: mksyntax.nx
63         ./mksyntax.nx
64
65 token.h: mktokens
66         sh ${.CURDIR}/mktokens
67
68 .include <bsd.prog.mk>