unstack, sort: cleanup and improvement
[minix.git] / commands / ash / Makefile
blob12e5fa34390de7ccb83733f5247e8c6f45c1ba03
1 # Makefile for ash.
3 .include <bsd.own.mk>
5 YHEADER=1
6 PROG= sh
8 SHSRCS= alias.c arith.y arith_lex.l cd.c echo.c error.c eval.c exec.c expand.c \
9 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
10 mystring.c options.c output.c parser.c redir.c show.c \
11 trap.c var.c setmode.c expr.c regexp.c
12 GENSRCS= builtins.c init.c nodes.c syntax.c operators.c signames.c
13 GENHDRS= builtins.h nodes.h syntax.h token.h operators.h signames.h
14 SRCS= ${SHSRCS} ${GENSRCS}
15 DPSRCS+=${GENHDRS}
16 BINDIR= /bin
17 MAN=
19 DPADD+= ${LIBL} ${LIBEDIT}
20 LDADD+= -ll -ledit
22 LFLAGS= -8 # 8-bit lex scanner for arithmetic
23 YFLAGS= -d
25 # The .depend file can get references to these temporary files
26 .OPTIONAL: lex.yy.c y.tab.c
28 # Enable this line to disable command line editing
29 #EDIT=-DNO_HISTORY
30 # Enable this line to use the editline library instead of libedit
31 EDIT=-DEDITLINE
33 # Enable this line if your system does not have a <paths.h>
34 #NO_PATHS_H=-DNO_PATHS_H
36 # Enable this if you don't want job control
37 NO_JOBS=-DJOBS=0
38 MKB_NO_JOBS=-j
40 CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
41 CPPFLAGS+=${EDIT} ${NO_PATHS_H} ${NO_JOBS}
43 .PATH: ${.CURDIR}/bltin
45 CLEANFILES+= mkinit mkinit.lo mknodes mknodes.lo \
46 mksyntax mksyntax.lo mksignames mksignames.lo
47 CLEANFILES+= ${GENSRCS} ${GENHDRS} y.tab.h
49 build-tools: mkinit mknodes mksyntax mksignames
51 .ORDER: builtins.c builtins.h
52 builtins.c builtins.h: mkbuiltins builtins.def shell.h
53 cd ${.CURDIR}; sh mkbuiltins ${MKB_NO_JOBS} ${.OBJDIR} shell.h builtins.def
55 init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
56 redir.c trap.c var.c
57 ./mkinit ${.ALLSRC:S/^mkinit$//}
59 mkinit: mkinit.lo
60 ${HOST_LINK.c} mkinit.lo -o $@
62 mknodes: mknodes.lo
63 ${HOST_LINK.c} mknodes.lo -o $@
64 mksyntax: mksyntax.lo
65 ${HOST_LINK.c} mksyntax.lo -o $@
66 mksignames: mksignames.lo
67 ${HOST_LINK.c} mksignames.lo -o $@
69 .ORDER: nodes.c nodes.h
70 nodes.c nodes.h: mknodes nodetypes nodes.c.pat
71 ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
73 .ORDER: syntax.c syntax.h
74 syntax.c syntax.h: mksyntax
75 ./mksyntax
77 token.h: mktokens
78 sh ${.CURDIR}/mktokens
80 .ORDER: signames.c signames.h
81 signames.c signames.h: mksignames
82 ./mksignames
84 .ORDER: operators.c operators.h
85 operators.c operators.h: mkexpr unary_op binary_op
86 sh ${.CURDIR}/bltin/mkexpr ${.CURDIR}/bltin/unary_op ${.CURDIR}/bltin/binary_op
88 arith.h: arith.c
89 arith.c: arith.y
91 .include <bsd.prog.mk>