From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from feline.systems ([99.23.220.214]) by ur; Sun Sep 4 23:16:35 EDT 2016 Date: Sun, 4 Sep 2016 23:16:29 -0400 From: BurnZeZ@feline.systems To: 9front@9front.org Subject: /sys/src/cmd/mkfile *.y error prevention Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-bkbmsycbesyycqzdbobjevrfgt" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: extension strategy This is a multi-part message in MIME format. --upas-bkbmsycbesyycqzdbobjevrfgt Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Attached diff is a suggested change to simplify[citation needed] the yfile stuff (only one change is needed to add a new yfile). There's probably a better way to do it, but I'm not a mk wizard. --upas-bkbmsycbesyycqzdbobjevrfgt Content-Disposition: attachment; filename=mkfile.diff Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit diff -r 094727ce1d7a sys/src/cmd/mkfile --- a/sys/src/cmd/mkfile Sat Sep 03 19:05:28 2016 +0200 +++ b/sys/src/cmd/mkfile Sun Sep 04 23:08:50 2016 -0400 @@ -4,6 +4,8 @@ HFILES=/$objtype/include/u.h /sys/include/libc.h /sys/include/bio.h BIN=/$objtype/bin PROGS=${TARG:%=$O.%} +YPROGS=bc mpc pc units # subset of $PROGS +YEXPR=`{echo $YPROGS | sed 's/ /|/g; s/^(.*)$/(\1)/'} LDFLAGS= YFLAGS=-d @@ -82,7 +84,7 @@ directories:V: install.directories cleanfiles:V: - rm -f [$OS].out *.[$OS] y.tab.? y.debug y.output [$OS].$TARG [$OS].units.tab $TARG bc.c bc.tab.h units.tab.h units.c mpc.c mpc.tab.h [$OS]._cp + rm -f [$OS].out *.[$OS] y.tab.? y.debug y.output [$OS].$TARG $TARG $YPROGS.c $YPROGS.tab.h [$OS]._cp %.clean:V: rm -f [$OS].$stem $stem.[$OS] @@ -103,12 +105,12 @@ mk $stem.install & } wait - rm -f $stem.[$OS] y.tab.? $stem.tab.? y.debug y.output [$OS].$stem bc.c bc.tab.h units.c mpc.c + rm -f $stem.[$OS] y.tab.? $stem.tab.? y.debug y.output [$OS].$stem $YPROGS.c %.acid: %.$O $HFILES $CC $CFLAGS -a $stem.c >$target -(bc|units|mpc|pc).c:R: \1.tab.c +$YEXPR.c:R: \1.tab.c mv $stem1.tab.c $stem1.c $BIN/init: $O.init --upas-bkbmsycbesyycqzdbobjevrfgt--