xref: /freebsd/bin/sh/Makefile (revision 8c48f4c5377ddc3dc55388f181f23111145f7099)
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}
47.endif
48
49.ORDER: builtins.c builtins.h
50builtins.h: .NOMETA
51builtins.c builtins.h: mkbuiltins builtins.def
52	sh ${.CURDIR}/mkbuiltins ${.CURDIR}
53
54
55.ORDER: nodes.c nodes.h
56nodes.h: .NOMETA
57nodes.c nodes.h: mknodes nodetypes nodes.c.pat
58	${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
59
60.ORDER: syntax.c syntax.h
61syntax.h: .NOMETA
62syntax.c syntax.h: mksyntax
63	${BTOOLSPATH:U.}/mksyntax
64
65token.h: mktokens
66	sh ${.CURDIR}/mktokens
67
68HAS_TESTS=
69SUBDIR.${MK_TESTS}+= tests
70
71beforeinstallconfig:
72	rm -f ${DESTDIR}/.profile
73
74LINKMODE=${CONFMODE}
75afterinstallconfig:
76	${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
77
78.include <bsd.prog.mk>
79