include: reduce default stack size
[minix.git] / commands / ash / Makefile
blob9075a9f22dd80ac969174817cd32a38a09386afd
1 # Makefile for ash.
3 .include <bsd.own.mk>
5 PROG= sh
6 BINDIR= /bin
7 MAN=
9 # Enable this line to disable command line editing
10 #EDIT=-DNO_HISTORY
11 # Enable this line to use the editline library instead of libedit
12 EDIT=-DEDITLINE
14 # Enable this line if your system does not have a <paths.h>
15 #NO_PATHS_H=-DNO_PATHS_H
17 # Enable this if you don't want job control
18 NO_JOBS=-DJOBS=0
19 MKB_NO_JOBS=-j
21 SRCS= alias.c arith.y arith_lex.l cd.c eval.c exec.c expand.c \
22 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
23 mystring.c options.c output.c parser.c redir.c show.c \
24 trap.c var.c setmode.c
26 .include "${.CURDIR}/bltin/Makefile.inc"
28 GENSRCS= builtins.c init.c nodes.c syntax.c operators.c signames.c
29 GENHDRS= builtins.h nodes.h syntax.h token.h operators.h signames.h
31 SRCS+= ${GENSRCS}
33 CLEANFILES+=${GENSRCS} ${GENHDRS}
35 DPADD+= ${LIBL} ${LIBEDIT}
36 LDADD+= -ll -ledit
38 CPPFLAGS+= -DSHELL -D__NBSD_LIBC
39 CPPFLAGS+=${EDIT} ${NO_PATHS_H} ${NO_JOBS}
41 CPPFLAGS+= -I. -I${.CURDIR}
43 # A. Generate C tools used to build ash
44 .for tool in init nodes signames syntax
45 ${.OBJDIR}/mk${tool}: ${.CURDIR}/mk${tool}.c
46 ${HOST_CC} ${.ALLSRC} -o ${.TARGET}
47 .endfor
49 # B. Generates C sources from C tools
50 NODES_ARGS:= ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
51 INIT_ARGS:= alias.c eval.c exec.c input.c jobs.c options.c parser.c \
52 redir.c trap.c var.c
54 .for tool in nodes signames syntax
55 ${tool}.c ${tool}.h: ${.OBJDIR}/mk${tool}
56 ${.OBJDIR}/mk${tool} ${${tool:tu}_ARGS}
57 .endfor
59 init.c: ${.OBJDIR}/mkinit \
60 alias.c eval.c exec.c input.c jobs.c options.c parser.c \
61 redir.c trap.c var.c
62 ${.OBJDIR}/mkinit ${.ALLSRC:S,^${.OBJDIR}/mkinit$,,}
64 # C. Generates C sources from shell scripts
65 token.h:
66 ${.CURDIR}/mktokens.sh
68 builtins.c builtins.h:
69 ${.CURDIR}/mkbuiltins.sh ${MKB_NO_JOBS} . ${.CURDIR}/shell.h ${.CURDIR}/builtins.def
71 operators.c operators.h:
72 ${.CURDIR}/bltin/mkexpr.sh ${.CURDIR}/bltin/unary_op ${.CURDIR}/bltin/binary_op
74 # D. Generates sources from yacc/lex
75 LFLAGS= -8 # 8-bit lex scanner for arithmetic
77 YFLAGS:= -d
78 CLEANFILES+= arith.h arith.y.o
80 parser.c: token.h
81 y.tab.h: arith.y
82 arith.h: y.tab.h
83 arith_lex.l: arith.h
85 # Explicit dependencies to ensure creation when needed
86 # LSC FIXME Under MINIX, the build system curiously needs more help.
87 # is it because of the missing order tools?
88 expand.c: arith.h
89 trap.c: signames.h
90 cd.c complete.c eval.c exec.c expand.c jobs.c main.c options.c parser.c redir.c show.c trap.c var.c: nodes.h
91 eval.c exec.c expand.c input.c input.h jobs.c mystring.c output.c parser.c trap.c var.c: syntax.h
92 cd.c eval.c exec.c histedit.cjobs.c main.c miscbltin.c options.c trap.c var.c: builtins.h
94 # LSC: Seems that this file is implicitly taken into account by NetBSD's make,
95 # still seems to be ignored / not found currently.
96 # It's a sad story, as it has default rules to manage yacc / lex files. So for
97 # a happy ending here it is explicitly included:
98 .include <sys.mk>
100 .include <bsd.prog.mk>