9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Problem with mk
@ 2013-12-18 15:23 Blake McBride
  2013-12-18 15:37 ` dexen deVries
  2013-12-18 16:11 ` Blake McBride
  0 siblings, 2 replies; 18+ messages in thread
From: Blake McBride @ 2013-12-18 15:23 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 2686 bytes --]

Greetings,

I have spent hours on a trivial problem that I still haven't figured out. I
am using 9front, and I am building a C app using mk.  I understand about
that parallel stuff so I am calling mk with -s for now.  There are actually
three problems, but the fact that it won't build is clearly the first.
 Here are the facts:

Problem 1:

If I execute "mk -s", mk prints out what it is executing interspersed with
messages from the command being executed.  Somewhere in the middle I see:

mk: ../../bin/dpp -g -t ... : status=rc 1357: dpp 1359: Exit code 1

Each time I run it, the two numbers (1357 & 1369) are different.  This
message is showing up in the middle of all of the commands getting executed.

If I execute "mk -n" and manually execute each command the build succeeds.

If I manually execute each command and append "; echo $status" to each
command, no error code is ever displayed.

Since I can build manually, and I get no error codes when I do so, I cannot
figure out what the problem is.

Problem 2:

Even though I am executing mk with the "-s" option, it still seems like it
is running in parallel because a subsequent command can't find a file
created by a prior command - as if it didn't wait for the prior command to
finish.  Remember this build fine, and without error codes, when executed
manually.

Problem 3:

Somehow Unix or GNU "make" doesn't mix up buffered stdout with unbuffered
stderr output.  They remain in order so the total out of make and all of
the commands are shown in order and in context.  You know, so a human can
understand it.  mk appears not to handle this the same.  stdout output and
stderr output are totally out of sequence making it very, very difficult to
understand what is going on.

----

Here is my mkfile:

</$objtype/mkfile

DYNACE_PATH = ../..

BINDIR = $DYNACE_PATH/bin
LIBDIR = $DYNACE_PATH/lib
INCDIR = $DYNACE_PATH/include

TARGET = main

CLASSES = class1.d

CFILES = main.c

OBJS = ${CFILES:%.c=%.$O} ${CLASSES:%.d=%.$O}

CFLAGS = -DPLAN9 -I$INCDIR -p

C_CLASSES = ${CLASSES:%.d=%.c}

%.$O : %.c
$CC $CFLAGS $stem.c

%.c : %.d
$BINDIR/dpp -g -p $prereq

$TARGET : generics.1 generics.h generics.$O $OBJS
$LD -o $target $OBJS generics.$O $LIBDIR/Dynace.a

generics.h : $CLASSES
$BINDIR/dpp -g -t generics.h generics.c generics.$O -h -s $newprereq

generics.c : generics.h
$BINDIR/dpp -g -c

generics.1 newgens: $INCDIR/generics.h
$BINDIR/dpp -g $INCDIR/generics.h -s $CLASSES -h
touch generics.1

clean realclean:VQ:
rm -f generics.* $TARGET *.$O $C_CLASSES


Any suggestion would sure be appreciated.

Thanks.

Blake McBride

[-- Attachment #2: Type: text/html, Size: 9422 bytes --]

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

end of thread, other threads:[~2013-12-19 16:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-18 15:23 [9fans] Problem with mk Blake McBride
2013-12-18 15:37 ` dexen deVries
2013-12-18 16:07   ` Blake McBride
2013-12-18 20:21   ` Blake McBride
2013-12-18 21:04     ` Jacob Todd
2013-12-18 21:14       ` Blake McBride
2013-12-19  8:16         ` dexen deVries
2013-12-19 16:20           ` Blake McBride
2013-12-18 16:11 ` Blake McBride
2013-12-18 16:40   ` Bakul Shah
2013-12-18 17:06     ` Aram Hăvărneanu
2013-12-18 17:18       ` Blake McBride
2013-12-18 17:27         ` Rubén Berenguel
2013-12-18 17:28     ` Blake McBride
2013-12-18 17:47       ` Kurt H Maier
2013-12-18 18:13       ` Bakul Shah
2013-12-18 18:20         ` Blake McBride
2013-12-18 18:28           ` Blake McBride

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).