9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Blake McBride <blake@mcbride.name>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] Problem with mk
Date: Wed, 18 Dec 2013 09:23:19 -0600	[thread overview]
Message-ID: <CABwHSOukAs36eJ2zA2Q=yeaN53hWAsm2EPOSZJmkOHkhTwXQBA@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2013-12-18 15:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 15:23 Blake McBride [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABwHSOukAs36eJ2zA2Q=yeaN53hWAsm2EPOSZJmkOHkhTwXQBA@mail.gmail.com' \
    --to=blake@mcbride.name \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).