Finish support for all required $(( )) (shell arithmetic) operators,
closing PR bin/50958
That meant adding the assignment operators ('=', and all of the +=, *= ...)
Currently, ++, --, and ',' are not implemented (none of those are required
by posix) but support for them (most likely ',' first) might be added later.
To do this, I removed the yacc/lex arithmetic parser completely, and
replaced it with a hand written recursive descent parser, that I obtained
from FreeBSD, who earlier had obtained it from dash (Herbert Xu).
While doing the import, I cleaned up the sources (changed some file names
to avoid requiring a clean build, or signifigant surgery to the obj
directories if "build.sh -u" was to be used - "build.sh -u" should work
fine as it is now) removed some dashisms, applied some KNF, ...
2017-03-20 14:26:07 +03:00
|
|
|
# $NetBSD: Makefile,v 1.104 2017/03/20 11:26:07 kre Exp $
|
1995-05-12 01:28:33 +04:00
|
|
|
# @(#)Makefile 8.4 (Berkeley) 5/5/95
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2001-04-18 21:35:36 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
PROG= sh
|
Finish support for all required $(( )) (shell arithmetic) operators,
closing PR bin/50958
That meant adding the assignment operators ('=', and all of the +=, *= ...)
Currently, ++, --, and ',' are not implemented (none of those are required
by posix) but support for them (most likely ',' first) might be added later.
To do this, I removed the yacc/lex arithmetic parser completely, and
replaced it with a hand written recursive descent parser, that I obtained
from FreeBSD, who earlier had obtained it from dash (Herbert Xu).
While doing the import, I cleaned up the sources (changed some file names
to avoid requiring a clean build, or signifigant surgery to the obj
directories if "build.sh -u" was to be used - "build.sh -u" should work
fine as it is now) removed some dashisms, applied some KNF, ...
2017-03-20 14:26:07 +03:00
|
|
|
SHSRCS= alias.c arith_token.c arithmetic.c cd.c echo.c error.c eval.c exec.c \
|
|
|
|
expand.c histedit.c input.c jobs.c mail.c main.c memalloc.c \
|
|
|
|
miscbltin.c mystring.c options.c parser.c redir.c show.c trap.c \
|
|
|
|
output.c var.c test.c kill.c syntax.c
|
|
|
|
GENSRCS=builtins.c init.c nodes.c
|
|
|
|
GENHDRS=builtins.h nodes.h token.h nodenames.h
|
1997-05-09 11:50:03 +04:00
|
|
|
SRCS= ${SHSRCS} ${GENSRCS}
|
1996-10-16 18:23:51 +04:00
|
|
|
|
2003-10-19 04:35:26 +04:00
|
|
|
DPSRCS+=${GENHDRS}
|
|
|
|
|
2010-02-07 02:45:24 +03:00
|
|
|
LDADD+= -ll -ledit -lterminfo
|
|
|
|
DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMINFO}
|
1996-10-16 18:23:51 +04:00
|
|
|
|
2008-10-20 02:05:19 +04:00
|
|
|
# Environment for scripts executed during build.
|
|
|
|
SCRIPT_ENV= \
|
|
|
|
AWK=${TOOL_AWK:Q} \
|
2008-10-26 02:23:55 +04:00
|
|
|
SED=${TOOL_SED:Q}
|
2008-10-20 02:05:19 +04:00
|
|
|
|
2009-10-29 17:21:40 +03:00
|
|
|
CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
|
2003-01-09 16:57:26 +03:00
|
|
|
#XXX: For testing only.
|
2010-08-30 10:26:59 +04:00
|
|
|
#CPPFLAGS+=-DDEBUG=2
|
|
|
|
#COPTS+=-g
|
2003-01-09 16:57:26 +03:00
|
|
|
#CFLAGS+=-funsigned-char
|
|
|
|
#TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char
|
1996-10-16 18:23:51 +04:00
|
|
|
|
2002-02-07 09:25:07 +03:00
|
|
|
.ifdef SMALLPROG
|
|
|
|
CPPFLAGS+=-DSMALL
|
2015-05-10 23:30:54 +03:00
|
|
|
.endif
|
|
|
|
.ifdef TINYPROG
|
|
|
|
CPPFLAGS+=-DTINY
|
2004-06-06 11:03:11 +04:00
|
|
|
.else
|
|
|
|
SRCS+=printf.c
|
2002-02-07 09:25:07 +03:00
|
|
|
.endif
|
|
|
|
|
2002-11-25 01:35:38 +03:00
|
|
|
.PATH: ${.CURDIR}/bltin ${NETBSDSRCDIR}/bin/test \
|
|
|
|
${NETBSDSRCDIR}/usr.bin/printf \
|
|
|
|
${NETBSDSRCDIR}/bin/kill
|
1993-03-21 12:45:37 +03:00
|
|
|
|
Finish support for all required $(( )) (shell arithmetic) operators,
closing PR bin/50958
That meant adding the assignment operators ('=', and all of the +=, *= ...)
Currently, ++, --, and ',' are not implemented (none of those are required
by posix) but support for them (most likely ',' first) might be added later.
To do this, I removed the yacc/lex arithmetic parser completely, and
replaced it with a hand written recursive descent parser, that I obtained
from FreeBSD, who earlier had obtained it from dash (Herbert Xu).
While doing the import, I cleaned up the sources (changed some file names
to avoid requiring a clean build, or signifigant surgery to the obj
directories if "build.sh -u" was to be used - "build.sh -u" should work
fine as it is now) removed some dashisms, applied some KNF, ...
2017-03-20 14:26:07 +03:00
|
|
|
CLEANFILES+= ${GENSRCS} ${GENHDRS} sh.html1
|
2017-03-16 16:09:06 +03:00
|
|
|
CLEANFILES+= trace.*
|
1996-10-16 18:23:51 +04:00
|
|
|
|
|
|
|
token.h: mktokens
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2008-10-20 02:05:19 +04:00
|
|
|
${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2009-12-14 08:13:38 +03:00
|
|
|
.ORDER: builtins.h builtins.c
|
|
|
|
builtins.h builtins.c: mkbuiltins shell.h builtins.def
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2009-12-14 08:13:38 +03:00
|
|
|
${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR}
|
|
|
|
[ -f builtins.h ]
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2004-01-17 14:47:30 +03:00
|
|
|
init.c: mkinit.sh ${SHSRCS}
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2008-10-20 02:05:19 +04:00
|
|
|
${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC}
|
1994-05-11 21:09:42 +04:00
|
|
|
|
2009-12-14 08:13:38 +03:00
|
|
|
.ORDER: nodes.h nodes.c
|
2009-12-11 11:39:42 +03:00
|
|
|
nodes.c nodes.h: mknodes.sh nodetypes nodes.c.pat
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2009-12-14 08:13:38 +03:00
|
|
|
${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} ${.OBJDIR}
|
|
|
|
[ -f nodes.h ]
|
2009-12-07 19:22:41 +03:00
|
|
|
|
2016-02-27 21:34:12 +03:00
|
|
|
nodenames.h: mknodenames.sh nodes.h
|
|
|
|
${_MKTARGET_CREATE}
|
|
|
|
${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
2003-10-18 11:58:35 +04:00
|
|
|
.if ${USETOOLS} == "yes"
|
2012-12-02 16:55:27 +04:00
|
|
|
NBCOMPATLIB= -L${TOOLDIR}/lib -lnbcompat
|
2003-10-18 11:58:35 +04:00
|
|
|
.endif
|
|
|
|
|
2010-08-22 06:09:36 +04:00
|
|
|
SUBDIR+=USD.doc
|
|
|
|
|
2011-08-14 14:53:16 +04:00
|
|
|
COPTS.printf.c = -Wno-format-nonliteral
|
2011-08-23 14:47:06 +04:00
|
|
|
COPTS.jobs.c = -Wno-format-nonliteral
|
2011-08-14 14:53:16 +04:00
|
|
|
|
1998-04-13 16:06:48 +04:00
|
|
|
.include <bsd.prog.mk>
|
2010-08-22 06:21:31 +04:00
|
|
|
.include <bsd.subdir.mk>
|