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

Reply via email to