Merge branch 'vendor/GCC50'
[dragonfly.git] / bin / sh / Makefile
1 # Makefile for /bin/sh
2 #
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 nodes.c syntax.c
12 GENHDRS= builtins.h nodes.h syntax.h token.h
13 SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
14
15 # would be needed if WARNS upgraded to 3, but lets keep the stderr output
16 # clean, so WARNS has been lowered to 2.
17 #
18 # NO_WERROR=    yes # [-Werror=clobbered] on gcc50
19 WARNS?= 2
20
21 # MLINKS for Shell built in commands for which there are no userland
22 # utilities of the same name are handled with the associated manpage,
23 # builtin.1 in share/man/man1/.
24
25 DPADD= ${LIBEDIT} ${LIBTERMCAP}
26 LDADD= -ledit -ltermcap
27
28 CFLAGS+=-DSHELL -I. -I${.CURDIR}
29 # for debug:
30 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
31
32 .if defined(BOOTSTRAPPING)
33 CFLAGS+= -DNO_HISTORY
34 .endif
35
36 .PATH:  ${.CURDIR}/bltin \
37         ${.CURDIR}/../kill \
38         ${.CURDIR}/../test \
39         ${.CURDIR}/../../usr.bin/printf
40
41 CLEANFILES+= mknodes.nx mknodes.no \
42         mksyntax.nx mksyntax.no
43 CLEANFILES+= ${GENSRCS} ${GENHDRS}
44
45 build-tools: mknodes.nx mksyntax.nx
46
47 .ORDER: builtins.c builtins.h
48 builtins.c builtins.h: mkbuiltins builtins.def
49         sh ${.CURDIR}/mkbuiltins ${.CURDIR}
50
51 # XXX this is just to stop the default .c rule being used, so that the
52 # intermediate object has a fixed name.
53 # XXX we have a default .c rule, but no default .o rule.
54 .o:
55         ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
56 mknodes.nx: mknodes.no
57 mksyntax.nx: mksyntax.no
58
59 .ORDER: nodes.c nodes.h
60 nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat
61         ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
62
63 .ORDER: syntax.c syntax.h
64 syntax.c syntax.h: mksyntax.nx
65         ./mksyntax.nx
66
67 token.h: mktokens
68         sh ${.CURDIR}/mktokens
69
70 regress: sh
71         cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
72 .include <bsd.prog.mk>