xref: /freebsd/bin/sh/Makefile (revision a25896ca1270e25b657ceaa8d47d5699515f5c25)
1#	@(#)Makefile	8.4 (Berkeley) 5/5/95
2# $FreeBSD$
3
4.include <src.opts.mk>
5
6CONFS=	dot.profile profile
7CONFSDIR_dot.profile=	/root
8CONFSNAME_dot.profile=	.profile
9PACKAGE=runtime
10PROG=	sh
11INSTALLFLAGS= -S
12SHSRCS=	alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
13	exec.c expand.c \
14	histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
15	mystring.c options.c output.c parser.c printf.c redir.c show.c \
16	test.c trap.c var.c
17GENSRCS= builtins.c nodes.c syntax.c
18GENHDRS= builtins.h nodes.h syntax.h token.h
19SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
20
21# MLINKS for Shell built in commands for which there are no userland
22# utilities of the same name are handled with the associated manpage,
23# builtin.1 in share/man/man1/.
24
25LIBADD=	edit
26
27CFLAGS+=-DSHELL -I. -I${.CURDIR}
28# for debug:
29# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
30WARNS?=	2
31WFORMAT=0
32
33.PATH:	${.CURDIR}/bltin \
34	${.CURDIR:H}/kill \
35	${.CURDIR:H}/test \
36	${SRCTOP}/usr.bin/printf
37
38CLEANFILES+= mknodes mksyntax
39CLEANFILES+= ${GENSRCS} ${GENHDRS}
40
41build-tools: mknodes mksyntax
42
43.ORDER: builtins.c builtins.h
44builtins.h: .NOMETA
45builtins.c builtins.h: mkbuiltins builtins.def
46	sh ${.CURDIR}/mkbuiltins ${.CURDIR}
47
48mknodes mksyntax: ${BUILD_TOOLS_META}
49
50.ORDER: nodes.c nodes.h
51nodes.h: .NOMETA
52nodes.c nodes.h: mknodes nodetypes nodes.c.pat
53	${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
54
55.ORDER: syntax.c syntax.h
56syntax.h: .NOMETA
57syntax.c syntax.h: mksyntax
58	${BTOOLSPATH:U.}/mksyntax
59
60token.h: mktokens
61	sh ${.CURDIR}/mktokens
62
63HAS_TESTS=
64SUBDIR.${MK_TESTS}+= tests
65
66beforeinstallconfig:
67	rm -f ${DESTDIR}/.profile
68
69afterinstallconfig:
70	${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
71
72.include <bsd.prog.mk>
73