9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] mk query
@ 2001-04-10 13:45 Stephen Parker
  0 siblings, 0 replies; only message in thread
From: Stephen Parker @ 2001-04-10 13:45 UTC (permalink / raw)
  To: '9fans@cse.psu.edu'

Not really a plan9 query, but I can't think of anywhere better to ask about
mk.
I'm building a system with mk, currently the mkfile looks a bit like this:

CFILES=\
	a.c\
	b.c\
	c.c

%.o: %.c
	$CC -o $stem.o $stem.c

(with many more C files etc).

I now want to selectively optimise some of the compilations.  Let's say that
I want a.c and b.c to be compiled without optimisation, and c.c to be
compiled
with optimisation.  My first attempt is:

CFILES=\
	a.c\
	b.c\
	c.c

c.o: c.c
	$CC -Ox -o c.o c.c

%.o: %.c
	$CC -o $stem.o $stem.c

Which works ok; but is not very extensible.  It would be nice to write:

CFILES=\
	a.c\
	b.c
OCFILES=\
	c.c

...

And let mk do the work.  Any suggestions of good ways to do this?

Thanks,
stephen


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-10 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-10 13:45 [9fans] mk query Stephen Parker

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