]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - bin/sh/Makefile
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / bin / sh / Makefile
1 #       @(#)Makefile    8.4 (Berkeley) 5/5/95
2 # $FreeBSD$
3
4 PROG=   sh
5 INSTALLFLAGS= -S
6 SHSRCS= alias.c arith.y arith_lex.l cd.c echo.c error.c eval.c exec.c expand.c \
7         histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
8         mystring.c options.c output.c parser.c redir.c show.c \
9         test.c trap.c var.c
10 GENSRCS= builtins.c init.c nodes.c syntax.c
11 GENHDRS= builtins.h nodes.h syntax.h token.h
12 SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} y.tab.h
13
14 # MLINKS for Shell built in commands for which there are no userland
15 # utilities of the same name are handled with the associated manpage,
16 # builtin.1 in share/man/man1/.
17
18 DPADD= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
19 LDADD= -ll -ledit -ltermcap
20
21 LFLAGS= -8      # 8-bit lex scanner for arithmetic
22 CFLAGS+=-DSHELL -I. -I${.CURDIR}
23 # for debug:
24 # CFLAGS+= -g -DDEBUG=2
25 WARNS?= 2
26 WFORMAT=0
27
28 .PATH:  ${.CURDIR}/bltin \
29         ${.CURDIR}/../../bin/test
30
31 CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
32         mksyntax mksyntax.o
33 CLEANFILES+= ${GENSRCS} ${GENHDRS}
34
35 build-tools: mkinit mknodes mksyntax
36
37 .ORDER: builtins.c builtins.h
38 builtins.c builtins.h: mkbuiltins builtins.def
39         cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
40
41 init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
42         redir.c trap.c var.c
43         ./mkinit ${.ALLSRC:S/^mkinit$//}
44
45 # XXX this is just to stop the default .c rule being used, so that the
46 # intermediate object has a fixed name.
47 # XXX we have a default .c rule, but no default .o rule.
48 .o:
49         ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
50 mkinit: mkinit.o
51 mknodes: mknodes.o
52 mksyntax: mksyntax.o
53
54 .ORDER: nodes.c nodes.h
55 nodes.c nodes.h: mknodes nodetypes nodes.c.pat
56         ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
57
58 .ORDER: syntax.c syntax.h
59 syntax.c syntax.h: mksyntax
60         ./mksyntax
61
62 token.h: mktokens
63         sh ${.CURDIR}/mktokens
64
65 .include <bsd.prog.mk>