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