gcc50: Disconnect from buildworld.
[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 \
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 WARNS?= 2
19
20 # MLINKS for Shell built in commands for which there are no userland
21 # utilities of the same name are handled with the associated manpage,
22 # builtin.1 in share/man/man1/.
23
24 CFLAGS+=-DSHELL -I. -I${.CURDIR}
25 # for debug:
26 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
27 # SHSRCS+=show.c
28
29 .if defined(BOOTSTRAPPING)
30 CFLAGS+= -DNO_HISTORY
31 # LIBEDIT is not needed here
32 .else
33 DPADD= ${LIBEDIT} ${LIBNCURSES}
34 LDADD= ${LIBEDIT} ${LIBNCURSES}
35 .endif
36
37
38 .PATH:  ${.CURDIR}/bltin \
39         ${.CURDIR}/../kill \
40         ${.CURDIR}/../test \
41         ${.CURDIR}/../../usr.bin/printf
42
43 #
44 # NOTE: the headers and sources in pregenerated/ must be updated upon any
45 # changes to the nodetypes nodes.c.pat mkbuiltins mknodes.c mksyntax.c mktokens
46 # files using following scripts and build programs.
47 #
48 .if 1 # not updating sh(1)
49 .PATH: ${.CURDIR}/pregenerated
50 CFLAGS+= -I${.CURDIR}/pregenerated
51 .else
52 CLEANFILES+= ${GENSRCS} ${GENHDRS}
53
54 .ORDER: builtins.c builtins.h
55 builtins.c builtins.h: mkbuiltins builtins.def
56         sh ${.CURDIR}/mkbuiltins ${.CURDIR}
57
58 # XXX this is just to stop the default .c rule being used, so that the
59 # intermediate object has a fixed name.
60 # XXX we have a default .c rule, but no default .o rule.
61 .o:
62         ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
63
64 .ORDER: nodes.c nodes.h
65 nodes.c nodes.h: nodetypes nodes.c.pat
66         ${.OBJDIR}/mknodes/mknodes.nx ${.ALLSRC}
67
68 .ORDER: syntax.c syntax.h
69 syntax.c syntax.h:
70         ${.OBJDIR}/mksyntax/mksyntax.nx
71
72 token.h: mktokens
73         sh ${.CURDIR}/mktokens
74 .endif
75
76 regress: sh
77         cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
78 .include <bsd.prog.mk>