1 # @(#)Makefile 8.4 (Berkeley) 5/5/95
2 # $FreeBSD: src/bin/sh/Makefile,v 1.57 2012/05/24 19:48:15 marcel Exp $
6 SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.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 \
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}
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}
26 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
28 .if defined(BOOTSTRAPPING)
32 .PATH: ${.CURDIR}/bltin \
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 \
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.
55 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
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
69 sh ${.CURDIR}/mktokens
72 cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
73 .include <bsd.prog.mk>