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: Re: [9fans] Problem with mk
Date: Wed, 18 Dec 2013 10:07:43 -0600	[thread overview]
Message-ID: <CABwHSOtn07vs4u09gAXLabyG0dg+8UT_+QrVozFOUOZLZLwCkg@mail.gmail.com> (raw)
In-Reply-To: <5446730.4oMZM0t5oA@coil>

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

Thanks for the help!  See below:


On Wed, Dec 18, 2013 at 9:37 AM, dexen deVries <dexen.devries@gmail.com>wrote:

> On Wednesday 18 of December 2013 09:23:19 Blake McBride wrote:
> >
> > Problem 1:
> >
>
>
> it seems you have an un-stated dependency/cies among your intermediate
> targets
> / prerequisites.
>
> Say, foo.o depends on foo.c and foo.h -- but foo.h also depends on
> generated_foo.h, which should be generated by make.
>
> in such case, explicitly state (no recipe is necessary):
>
>
> foo.h: generated_foo.h
>
>
> so mk knows the `generated_foo.h' must be completed first.
>



Yea, actually my build process is a bit more complex than that.  What I am
doing reflects that complexity and works perfectly with make.

_Initially_ (the first time), generics.h gets built through the generics.1
target, and then updated through the generics.h target process.
 Thereafter, as the program evolves, new classes are added (*.d files) and
changed, generics.h gets updated through the generics.h process only.  The
generics.h target process reads in generics.h and updates it based on the
changed *.d files.  You can think of generics.h as a database of generic
functions that needs to be initialized and then updated as the system
evolves.

The purpose of using rules rather than explicit recipes is because the
mkfile is often used as a template for much larger projects.  The pattern
is convenient.  Larger projects just have to update the three variables
TARGET, CLASSES, and CFILES.  If I don't use recipes, the mkfile gets
unnecessarily lengthy with larger projects.

Also, in spite of my use of a recipe rather than an explicit rule, why
would that cause mk to barf?




>
>
> > 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.
>
>
>
> -s won't help you there, because it regards processing of /command line/
> arguments, not of prerequisites. consider:
>
> $ NPROC=1 mk my_target
>
> also investigate -d[egp] debug stuff.
>

Yes, I didn't see a difference with or without the -s.  I just used it to
eliminate one possible source of problems.  Also, the random intermixing of
stdout and stderr causes me not to know what the order of execution is.


>
>
> have fun with mk, it's a great little tool :-)
>

I'm sure it is.  If I can get it to treat generics.h as a database as I
described above, it would be great.

Thanks!


>
>
>
> --
> dexen deVries
>
> [[[↓][→]]]
>
> Take care of the luxuries and the necessities will take care of themselves.
>                 -- L. Long
>
>
>

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

  reply	other threads:[~2013-12-18 16:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 15:23 Blake McBride
2013-12-18 15:37 ` dexen deVries
2013-12-18 16:07   ` Blake McBride [this message]
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=CABwHSOtn07vs4u09gAXLabyG0dg+8UT_+QrVozFOUOZLZLwCkg@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).