[m-dev.] Re: for review: MLOBJS.

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Mar 13 17:59:12 AEDT 1998


On 13-Mar-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 13-Mar-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 20-Feb-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > > Fix bugs in how MLOBJS works.
> > > 
> > > Because mmake puts the contents of the .dep file before the Mmakefile
> > > when generating a makefile for gmake, the scheme of using
> > > 	MLOBJS=foo.o bar.o
> > > in the Mmakefile won't work. The dependencies in the .dep file such as
> > > 	libxyz.a: ..... $(MLOBJS)
> > > are expanded when read, but MLOBJS is not set until later. This means
> > > MLOBJS won't be generated from the .c files.
> > > 
> > > So the solution is to output
> > > 	libxyz.a: ..... MLOBJS
> > > where MLOBJS is a target, and is defined in Mmake.rules (which is seen
> > > by make after the contents of Mmakefile).
> > > 	MLOBJS: $(MLOBJS).
> > 
> > The trouble with this is that if MLOBJS is empty, then
> > Make will always rebuild libxyz.a, even if nothing has changed.
> 
> Hmmm... If MLOBJS is *non-empty*, it will always rebuild MLOBJS,
> even if nothing has changed.
> 
> Any ideas on fixing it?

Hmm.

I guess you could make it a real (non-pseudo) target using `touch'.

	MLOBJS-%: $(MLOBJS)
		touch $@

But that creates Yet Another File.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list