Merge branch 'vendor/LDNS'
[dragonfly.git] / bin / sh / Makefile
1 #       @(#)Makefile    8.4 (Berkeley) 5/5/95
2 # $FreeBSD: src/bin/sh/Makefile,v 1.56 2011/02/08 23:18:06 jilles Exp $
3
4 PROG=   sh
5 INSTALLFLAGS= -S
6 SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
7         exec.c expand.c \
8         histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
9         mystring.c options.c output.c parser.c printf.c redir.c show.c \
10         test.c trap.c var.c
11 GENSRCS= builtins.c init.c nodes.c syntax.c
12 GENHDRS= builtins.h nodes.h syntax.h token.h
13 SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
14
15 # MLINKS for Shell built in commands for which there are no userland
16 # utilities of the same name are handled with the associated manpage,
17 # builtin.1 in share/man/man1/.
18
19 DPADD= ${LIBEDIT} ${LIBTERMCAP}
20 LDADD= -ledit -ltermcap
21
22 CFLAGS+=-DSHELL -I. -I${.CURDIR}
23 # for debug:
24 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
25
26 .if defined(BOOTSTRAPPING)
27 CFLAGS+= -DNO_HISTORY
28 .endif
29
30 .PATH:  ${.CURDIR}/bltin \
31         ${.CURDIR}/../kill \
32         ${.CURDIR}/../test \
33         ${.CURDIR}/../../usr.bin/printf
34
35 CLEANFILES+= mkinit.nx mkinit.no mknodes.nx mknodes.no \
36         mksyntax.nx mksyntax.no
37 CLEANFILES+= ${GENSRCS} ${GENHDRS}
38
39 build-tools: mkinit.nx mknodes.nx mksyntax.nx
40
41 .ORDER: builtins.c builtins.h
42 builtins.c builtins.h: mkbuiltins builtins.def
43         cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
44
45 init.c: mkinit.nx alias.c eval.c exec.c input.c jobs.c options.c parser.c \
46         redir.c trap.c var.c
47         ./mkinit.nx ${.ALLSRC:S/^mkinit.nx$//}
48
49 # XXX this is just to stop the default .c rule being used, so that the
50 # intermediate object has a fixed name.
51 # XXX we have a default .c rule, but no default .o rule.
52 .o:
53         ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
54 mkinit.nx: mkinit.no
55 mknodes.nx: mknodes.no
56 mksyntax.nx: mksyntax.no
57
58 .ORDER: nodes.c nodes.h
59 nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat
60         ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
61
62 .ORDER: syntax.c syntax.h
63 syntax.c syntax.h: mksyntax.nx
64         ./mksyntax.nx
65
66 token.h: mktokens
67         sh ${.CURDIR}/mktokens
68
69 regress: sh
70         cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
71 .include <bsd.prog.mk>