1 # @(#)Makefile 8.4 (Berkeley) 5/5/95
2 # $FreeBSD: head/bin/sh/Makefile 322515 2017-08-14 19:21:37Z ngie $
9 SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
11 histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
12 mystring.c options.c output.c parser.c printf.c redir.c show.c \
14 GENSRCS= builtins.c nodes.c syntax.c
15 GENHDRS= builtins.h nodes.h syntax.h token.h
16 SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
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/.
24 CFLAGS+=-DSHELL -I. -I${.CURDIR}
26 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
30 .PATH: ${.CURDIR}/bltin \
33 ${SRCTOP}/usr.bin/printf
35 CLEANFILES+= mknodes mknodes.o \
37 CLEANFILES+= ${GENSRCS} ${GENHDRS}
39 build-tools: mknodes mksyntax
41 .ORDER: builtins.c builtins.h
43 builtins.c builtins.h: mkbuiltins builtins.def
44 sh ${.CURDIR}/mkbuiltins ${.CURDIR}
46 # XXX this is just to stop the default .c rule being used, so that the
47 # intermediate object has a fixed name.
48 # XXX we have a default .c rule, but no default .o rule.
49 mknodes.o mksyntax.o: ${BUILD_TOOLS_META}
50 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
51 mknodes: mknodes.o ${BUILD_TOOLS_META}
52 mksyntax: mksyntax.o ${BUILD_TOOLS_META}
54 .ORDER: nodes.c nodes.h
56 nodes.c nodes.h: mknodes nodetypes nodes.c.pat
57 ${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
59 .ORDER: syntax.c syntax.h
61 syntax.c syntax.h: mksyntax
62 ${BTOOLSPATH:U.}/mksyntax
65 sh ${.CURDIR}/mktokens
68 SUBDIR.${MK_TESTS}+= tests
70 .include <bsd.prog.mk>