ncurses solidation: Remove all references to libtermcap
[dragonfly.git] / bin / sh / Makefile
blob4668061ebb6dcb167ae7df1c71c1b9b630d95722
1 # Makefile for /bin/sh
4 PROG= sh
5 INSTALLFLAGS= -S
6 SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
7 exec.c expand.c \
8 histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
9 mystring.c options.c output.c parser.c printf.c redir.c show.c \
10 test.c trap.c var.c
11 GENSRCS= builtins.c nodes.c syntax.c
12 GENHDRS= builtins.h nodes.h syntax.h token.h
13 SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
15 # would be needed if WARNS upgraded to 3, but lets keep the stderr output
16 # clean, so WARNS has been lowered to 2.
18 # NO_WERROR= yes # [-Werror=clobbered] on gcc50
19 WARNS?= 2
21 # MLINKS for Shell built in commands for which there are no userland
22 # utilities of the same name are handled with the associated manpage,
23 # builtin.1 in share/man/man1/.
25 CFLAGS+=-DSHELL -I. -I${.CURDIR}
26 # for debug:
27 # DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
29 .if defined(BOOTSTRAPPING)
30 CFLAGS+= -DNO_HISTORY
31 . if exists(/usr/lib/libedit.a)
32 DPADD= /usr/lib/libedit.a
33 LDADD= -ledit
34 . elif exists(/usr/lib/libprivate_edit.a)
35 DPADD= /usr/lib/libprivate_edit.a
36 LDADD= -lprivate_edit
37 . else
38 DPADD= ${LIBEDIT}
39 LDADD= -lprivate_edit
40 LDFLAGS+= -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
41 . endif
42 . if exists(/usr/lib/libtermcap.a)
43 DPADD+= /usr/lib/libtermcap.a
44 LDADD+= -ltermcap
45 . else
46 DPADD+= ${LIBNCURSES}
47 LDADD+= -lprivate_ncurses
48 LDFLAGS+= -rpath /lib/priv -L /usr/lib/priv
49 . endif
50 .else
51 DPADD= ${LIBEDIT} ${LIBNCURSES}
52 LDADD= -lprivate_edit -lprivate_ncurses
53 LDFLAGS+= -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
54 .endif
57 .PATH: ${.CURDIR}/bltin \
58 ${.CURDIR}/../kill \
59 ${.CURDIR}/../test \
60 ${.CURDIR}/../../usr.bin/printf
62 CLEANFILES+= mknodes.nx mknodes.no \
63 mksyntax.nx mksyntax.no
64 CLEANFILES+= ${GENSRCS} ${GENHDRS}
66 build-tools: mknodes.nx mksyntax.nx
68 .ORDER: builtins.c builtins.h
69 builtins.c builtins.h: mkbuiltins builtins.def
70 sh ${.CURDIR}/mkbuiltins ${.CURDIR}
72 # XXX this is just to stop the default .c rule being used, so that the
73 # intermediate object has a fixed name.
74 # XXX we have a default .c rule, but no default .o rule.
75 .o:
76 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
77 mknodes.nx: mknodes.no
78 mksyntax.nx: mksyntax.no
80 .ORDER: nodes.c nodes.h
81 nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat
82 ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
84 .ORDER: syntax.c syntax.h
85 syntax.c syntax.h: mksyntax.nx
86 ./mksyntax.nx
88 token.h: mktokens
89 sh ${.CURDIR}/mktokens
91 regress: sh
92 cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
93 .include <bsd.prog.mk>