Merge branch 'vendor/OPENSSL'
[dragonfly.git] / bin / sh / Makefile
1 #       @(#)Makefile    8.4 (Berkeley) 5/5/95
2 # $FreeBSD: head/bin/sh/Makefile 235927 2012-05-24 19:48:15Z marcel $
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 WARNS?= 3
16 NO_WERROR=      yes # [-Werror=clobbered] on gcc50
17
18 # MLINKS for Shell built in commands for which there are no userland
19 # utilities of the same name are handled with the associated manpage,
20 # builtin.1 in share/man/man1/.
21
22 DPADD= ${LIBEDIT} ${LIBTERMCAP}
23 LDADD= -ledit -ltermcap
24
25 CFLAGS+=-DSHELL -I. -I${.CURDIR}
26 # for debug:
27 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
28
29 .if defined(BOOTSTRAPPING)
30 CFLAGS+= -DNO_HISTORY
31 .endif
32
33 .PATH:  ${.CURDIR}/bltin \
34         ${.CURDIR}/../kill \
35         ${.CURDIR}/../test \
36         ${.CURDIR}/../../usr.bin/printf
37
38 CLEANFILES+= mknodes.nx mknodes.no \
39         mksyntax.nx mksyntax.no
40 CLEANFILES+= ${GENSRCS} ${GENHDRS}
41
42 build-tools: mknodes.nx mksyntax.nx
43
44 .ORDER: builtins.c builtins.h
45 builtins.c builtins.h: mkbuiltins builtins.def
46         sh ${.CURDIR}/mkbuiltins ${.CURDIR}
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 mknodes.nx: mknodes.no
54 mksyntax.nx: mksyntax.no
55
56 .ORDER: nodes.c nodes.h
57 nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat
58         ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
59
60 .ORDER: syntax.c syntax.h
61 syntax.c syntax.h: mksyntax.nx
62         ./mksyntax.nx
63
64 token.h: mktokens
65         sh ${.CURDIR}/mktokens
66
67 regress: sh
68         cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
69 .include <bsd.prog.mk>