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