sh: Sync with FreeBSD:
[dragonfly.git] / bin / sh / Makefile
blobbab4cf3d376245a7f78aa5fc932e7e225c3eb7e2
1 # @(#)Makefile 8.4 (Berkeley) 5/5/95
2 # $FreeBSD: head/bin/sh/Makefile 235927 2012-05-24 19:48:15Z marcel $
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}
15 WARNS?= 3
17 # MLINKS for Shell built in commands for which there are no userland
18 # utilities of the same name are handled with the associated manpage,
19 # builtin.1 in share/man/man1/.
21 DPADD= ${LIBEDIT} ${LIBTERMCAP}
22 LDADD= -ledit -ltermcap
24 CFLAGS+=-DSHELL -I. -I${.CURDIR}
25 # for debug:
26 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
28 .if defined(BOOTSTRAPPING)
29 CFLAGS+= -DNO_HISTORY
30 .endif
32 .PATH: ${.CURDIR}/bltin \
33 ${.CURDIR}/../kill \
34 ${.CURDIR}/../test \
35 ${.CURDIR}/../../usr.bin/printf
37 CLEANFILES+= mkinit.nx mkinit.no mknodes.nx mknodes.no \
38 mksyntax.nx mksyntax.no
39 CLEANFILES+= ${GENSRCS} ${GENHDRS}
41 build-tools: mkinit.nx mknodes.nx mksyntax.nx
43 .ORDER: builtins.c builtins.h
44 builtins.c builtins.h: mkbuiltins builtins.def
45 sh ${.CURDIR}/mkbuiltins ${.CURDIR}
47 init.c: mkinit.nx alias.c eval.c exec.c input.c jobs.c options.c parser.c \
48 redir.c trap.c var.c
49 ./mkinit.nx ${.ALLSRC:S/^mkinit.nx$//}
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 mkinit.nx: mkinit.no
57 mknodes.nx: mknodes.no
58 mksyntax.nx: mksyntax.no
60 .ORDER: nodes.c nodes.h
61 nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat
62 ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
64 .ORDER: syntax.c syntax.h
65 syntax.c syntax.h: mksyntax.nx
66 ./mksyntax.nx
68 token.h: mktokens
69 sh ${.CURDIR}/mktokens
71 regress: sh
72 cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
73 .include <bsd.prog.mk>