> 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 '
> <mkshell
> 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.