From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] p9p mk issue From: "Russ Cox" Date: Thu, 22 Nov 2007 14:48:43 -0500 In-Reply-To: <20071122174322.E07B55B3E@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20071122194833.1FE151E8C22@holo.morphisms.net> Topicbox-Message-UUID: 090ec39e-ead3-11e9-9d60-3106f5b1d025 > That was the first thing I tried -- didn't I mention that in > my original email on this? But setting MKSHELL in an > included file works for only that file and then we are back > to sh. > > Try this and watch it fail: > > echo MKSHELL=rc > mkshell > echo ' > all: > for (i in a b) > echo $i > ' > mkfile > mk That's not what I meant. I meant that if you have complicated things like loops then you can put those recipes all in one file (that also contains MKSHELL=rc) and just include it. Essentially all the Plan 9 mkfiles set HFILES, OFILES, TARG, and then include mkone, mkmany, and mksyslib. Only those would possibly need to declare a MKSHELL. As another example, p9p goes farther than Plan 9 in this respect and has a $PLAN9/src/mkdirs that contains the typical loop over directories and defines not just "all" but "clean" and "nuke" and the rest. Clients just define a variable and then include mkdirs: <$PLAN9/src/mkhdr LIBS=common PROGS=smtp alias fs ned q send marshal vf # libs must be made first DIRS=$LIBS $PROGS <$PLAN9/src/mkdirs If you were going to use rc syntax in mkdirs, then it would be the only file that needs to say MKSHELL=rc. Russ P. S. I realize it's suboptimal to have to set MKSHELL in each mkfile that uses rc-specific features, but it's the only way that scales.