Makefile revision 262951
1#	@(#)Makefile	8.4 (Berkeley) 5/5/95
2# $FreeBSD: stable/10/bin/sh/Makefile 262951 2014-03-09 17:04:31Z jmmv $
3
4.include <bsd.own.mk>
5
6PROG=	sh
7INSTALLFLAGS= -S
8SHSRCS=	alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
9	exec.c expand.c \
10	histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
11	mystring.c options.c output.c parser.c printf.c redir.c show.c \
12	test.c trap.c var.c
13GENSRCS= builtins.c nodes.c syntax.c
14GENHDRS= builtins.h nodes.h syntax.h token.h
15SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
16
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/.
20
21DPADD= ${LIBEDIT} ${LIBTERMCAP}
22LDADD= -ledit -ltermcap
23
24CFLAGS+=-DSHELL -I. -I${.CURDIR}
25# for debug:
26# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
27WARNS?=	2
28WFORMAT=0
29
30.PATH:	${.CURDIR}/bltin \
31	${.CURDIR}/../kill \
32	${.CURDIR}/../test \
33	${.CURDIR}/../../usr.bin/printf
34
35CLEANFILES+= mknodes mknodes.o \
36	mksyntax mksyntax.o
37CLEANFILES+= ${GENSRCS} ${GENHDRS}
38
39build-tools: mknodes mksyntax
40
41.ORDER: builtins.c builtins.h
42builtins.c builtins.h: mkbuiltins builtins.def
43	sh ${.CURDIR}/mkbuiltins ${.CURDIR}
44
45# XXX this is just to stop the default .c rule being used, so that the
46# intermediate object has a fixed name.
47# XXX we have a default .c rule, but no default .o rule.
48.o:
49	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
50mknodes: mknodes.o
51mksyntax: mksyntax.o
52
53.ORDER: nodes.c nodes.h
54nodes.c nodes.h: mknodes nodetypes nodes.c.pat
55	./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
56
57.ORDER: syntax.c syntax.h
58syntax.c syntax.h: mksyntax
59	./mksyntax
60
61token.h: mktokens
62	sh ${.CURDIR}/mktokens
63
64.if ${MK_TESTS} != "no"
65SUBDIR+=    tests
66.endif
67
68.include <bsd.prog.mk>
69