9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: [9fans] mk question
Date: Fri, 15 Oct 2004 23:23:48 +0100	[thread overview]
Message-ID: <97cf6a6e603204e68ecb28ccf32cefa3@vitanuova.com> (raw)
In-Reply-To: <fc8f4c2c061263e93ed354e399b8db80@plan9.ucalgary.ca>

i'm sure i'm being stupid here, but i can't see how i should solve
this problem.

i've got build tree which holds (amongst other things) a program to be
compiled, which when run processes a data file to produce several
source code and some header files as output, which must in turn be
compiled.

i'd like to express these dependencies in a mkfile.

i've written a mkfile that looks like this:

	# mktypeset produces four output files from a .typeset file.
	%.b %.m %types.b %types.m: %.typeset
		mktypeset $stem.typeset

	# limbo compiles a .b into a .dis
	%.dis: %.b
		limbo -gw $stem.b

	# specify three current .typeset files.
	TYPESETS=abc grid fs

	DISFILES=${TYPESETS:%=%.dis} ${TYPESETS:%=%types.dis} 

	# all dis files (apart from mktypeset.dis) depend on the header files
	$DISFILES: ${TYPESETS:%=%.m} ${TYPESETS:%=%types.m}

	all:V: $DISFILES mktypeset.dis


however, this doesn't express the dependency that mktypeset.dis needs
to be built before running it.

if i change the first rule to:

	%.b %.m %types.b %types.m: %.typeset mktypeset.dis
		mktypeset $stem.typeset

then i get:

	mk: cycle in graph detected at target mktypeset.dis

any ideas?



  reply	other threads:[~2004-10-15 22:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-15 20:36 [9fans] scrollbuttons 2.0 andrey mirtchovski
2004-10-15 22:23 ` rog [this message]
2004-10-15 22:47   ` [9fans] mk question Russ Cox
2004-10-16  8:01     ` Bruce Ellis
2004-10-16 11:23   ` Charles Forsyth
2004-10-15 23:37 ` [9fans] scrollbuttons 2.0 Enache Adrian
2004-10-15 23:54   ` andrey mirtchovski
2004-10-18  9:38   ` Fco. J. Ballesteros
2004-10-20 17:49     ` Enache Adrian

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=97cf6a6e603204e68ecb28ccf32cefa3@vitanuova.com \
    --to=rog@vitanuova.com \
    --cc=9fans@cse.psu.edu \
    /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).