9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] p9p mk issue
@ 2007-11-20 21:01 Bakul Shah
  2007-11-20 21:08 ` Pietro Gagliardi
  2007-11-20 21:44 ` Pietro Gagliardi
  0 siblings, 2 replies; 15+ messages in thread
From: Bakul Shah @ 2007-11-20 21:01 UTC (permalink / raw)
  To: 9fans

Don't laugh but I am trying to use identical mkfiles on
FreeBSD & plan9 for some programs and it seems this is
impossible.

Consider a simple mkfile like this:

all:
	for (i in a b c)
		echo $i

9 mk fails with
Syntax error: Bad for loop variable
mk:    ...  : exit status=exit(2)

On rereading the p9p mk man page I discover MKSHELL.  So next
I add MKSHELL=... line at top of the above mkfile and now it
works.  Since I want most mkfiles to be portable, I add this
line in a mkfile included with < but it uses its own copy of
MKSHELL.  So then I tried

MKSHELL=$PLAN9/bin/rc 9 mk

but that doesn't help either.  Change mkfile to this now

MKSHELL=$PLAN9/bin/rc
FOO=fum
all:
	for (i in a b c)
		echo $i $MKSHELL $FOO

But echo shows "a sh fum" etc. which is rather surprising.

Rather than try this hard to please sh users, would it make
sense to just use rc?  After all this is *plan9* mk!  To be
nice mk can pay attention to MKSHELL env. variable but that's
about it.  Even as a non-unix-hater I'd be perfectly happy
with that!

-- bakul


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-11-30 19:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-20 21:01 [9fans] p9p mk issue Bakul Shah
2007-11-20 21:08 ` Pietro Gagliardi
2007-11-20 21:44 ` Pietro Gagliardi
2007-11-20 22:20   ` Jeff Sickel
2007-11-20 22:48     ` Bakul Shah
2007-11-21  7:44       ` John Stalker
2007-11-21 16:01       ` Russ Cox
2007-11-21 18:01         ` Bakul Shah
2007-11-21 19:57           ` Pietro Gagliardi
2007-11-22 15:47           ` Russ Cox
2007-11-22 17:43             ` Bakul Shah
2007-11-22 18:20               ` Martin Neubauer
2007-11-22 19:48               ` Russ Cox
2007-11-30 18:01                 ` Bakul Shah
2007-11-30 19:01                   ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).