xref: /freebsd/bin/sh/Makefile (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1#	@(#)Makefile	8.4 (Berkeley) 5/5/95
2
3.include <src.opts.mk>
4
5CONFGROUPS=	ETC ROOT
6ETC=	profile
7ROOT=	dot.shrc dot.profile
8ROOTDIR=	/root
9ROOTNAME_dot.shrc=	.shrc
10ROOTNAME_dot.profile=	.profile
11PACKAGE=runtime
12PROG=	sh
13INSTALLFLAGS= -S
14SHSRCS=	alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
15	exec.c expand.c \
16	histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
17	mystring.c options.c output.c parser.c printf.c redir.c show.c \
18	test.c trap.c var.c
19GENSRCS= builtins.c nodes.c syntax.c
20GENHDRS= builtins.h nodes.h syntax.h token.h
21SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
22
23# MLINKS for Shell built in commands for which there are no userland
24# utilities of the same name are handled with the associated manpage,
25# builtin.1 in share/man/man1/.
26
27LIBADD=	edit
28
29CFLAGS+=-DSHELL -I. -I${.CURDIR}
30# for debug:
31# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
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
41.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no"
42build-tools: mknodes mksyntax
43
44DEPENDOBJS+= mknodes mksyntax
45mknodes mksyntax: ${BUILD_TOOLS_META}
46builtins.c builtins.h: mkbuiltins
47syntax.c syntax.h: mksyntax
48nodes.c nodes.h: mknodes
49.endif
50
51.ORDER: builtins.c builtins.h
52builtins.h: .NOMETA
53builtins.c builtins.h: builtins.def
54	sh ${.CURDIR}/mkbuiltins ${.CURDIR}
55
56
57.ORDER: nodes.c nodes.h
58nodes.h: .NOMETA
59nodes.c nodes.h: nodetypes nodes.c.pat
60	${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
61
62.ORDER: syntax.c syntax.h
63syntax.h: .NOMETA
64syntax.c syntax.h:
65	${BTOOLSPATH:U.}/mksyntax
66
67token.h: mktokens
68	sh ${.CURDIR}/mktokens
69
70HAS_TESTS=
71SUBDIR.${MK_TESTS}+= tests
72
73beforeinstallconfig:
74	rm -f ${DESTDIR}/.profile
75
76LINKMODE=${CONFMODE}
77afterinstallconfig:
78	${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
79
80.include <bsd.prog.mk>
81