add opendir alias
[minix.git] / commands / ash / Makefile
blobb0a06dec7dc6ed5a4e8435052332b675c2084fcf
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
12 # Enable this line if your system does not have a <paths.h>
13 #NO_PATHS_H=-DNO_PATHS_H
15 # Enable this if you don't want job control
16 NO_JOBS=-DJOBS=0
17 MKB_NO_JOBS=-j
19 SRCS= alias.c arith.y arith_lex.l cd.c complete.c eval.c exec.c expand.c \
20 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
21 mystring.c options.c output.c parser.c redir.c show.c \
22 trap.c var.c setmode.c
24 .include "${.CURDIR}/bltin/Makefile.inc"
26 GENSRCS= builtins.c init.c nodes.c syntax.c operators.c signames.c
27 GENHDRS= builtins.h nodes.h syntax.h token.h operators.h signames.h
29 SRCS+= ${GENSRCS}
31 CLEANFILES+=${GENSRCS} ${GENHDRS}
33 DPADD+= ${LIBL} ${LIBEDIT}
34 LDADD+= -ll -ledit
36 CPPFLAGS+= -DSHELL -D__NBSD_LIBC
37 CPPFLAGS+=${EDIT} ${NO_PATHS_H} ${NO_JOBS}
39 CPPFLAGS+= -I. -I${.CURDIR}
41 # A. Generate C tools used to build ash
42 .for tool in init nodes signames syntax
43 ${.OBJDIR}/mk${tool}: ${.CURDIR}/mk${tool}.c
44 ${HOST_CC} ${.ALLSRC} -o ${.TARGET}
45 .endfor
47 # B. Generates C sources from C tools
48 NODES_ARGS:= ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
49 INIT_ARGS:= alias.c eval.c exec.c input.c jobs.c options.c parser.c \
50 redir.c trap.c var.c
52 .for tool in nodes signames syntax
53 ${tool}.c ${tool}.h: ${.OBJDIR}/mk${tool}
54 ${.OBJDIR}/mk${tool} ${${tool:tu}_ARGS}
55 .endfor
57 init.c: ${.OBJDIR}/mkinit \
58 alias.c eval.c exec.c input.c jobs.c options.c parser.c \
59 redir.c trap.c var.c
60 ${.OBJDIR}/mkinit ${.ALLSRC:S,^${.OBJDIR}/mkinit$,,}
62 # C. Generates C sources from shell scripts
63 token.h:
64 ${.CURDIR}/mktokens.sh
66 builtins.c builtins.h:
67 ${.CURDIR}/mkbuiltins.sh ${MKB_NO_JOBS} . ${.CURDIR}/shell.h ${.CURDIR}/builtins.def
69 operators.c operators.h:
70 ${.CURDIR}/bltin/mkexpr.sh ${.CURDIR}/bltin/unary_op ${.CURDIR}/bltin/binary_op
72 # D. Generates sources from yacc/lex
73 LFLAGS= -8 # 8-bit lex scanner for arithmetic
75 YFLAGS:= -d
76 CLEANFILES+= arith.h arith.y.o
78 parser.c: token.h
79 y.tab.h: arith.y
80 arith.h: y.tab.h
81 arith_lex.l: arith.h
83 # Explicit dependencies to ensure creation when needed
84 # LSC FIXME Under MINIX, the build system curiously needs more help.
85 # is it because of the missing order tools?
86 expand.c: arith.h
87 trap.c: signames.h
88 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
89 eval.c exec.c expand.c input.c input.h jobs.c mystring.c output.c parser.c trap.c var.c: syntax.h
90 cd.c eval.c exec.c histedit.cjobs.c main.c miscbltin.c options.c trap.c var.c: builtins.h
92 # LSC: Seems that this file is implicitly taken into account by NetBSD's make,
93 # still seems to be ignored / not found currently.
94 # It's a sad story, as it has default rules to manage yacc / lex files. So for
95 # a happy ending here it is explicitly included:
96 .include <sys.mk>
98 .include <bsd.prog.mk>