[m-dev.] Clean targets and optimisation files

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Aug 6 15:19:16 AEST 1999


On 06-Aug-1999, Warwick Harvey <wharvey at cs.monash.edu.au> wrote:
> I now think all one really needs is:
> 
> 1 - remove absolutely everything that can be regenerated
> 
> 2 - remove everything that is grade-dependent

Well, there are other possibilities.
See the "Standard targets" section of the "Makefile Conventions"
section of the GNU Make manual for some more information on this
topic.  This lists `clean', `mostlyclean', `maintainer-clean',
and `distclean' targets and explains their semantics.

> (1) obviously should be handled by "mmake realclean".  (2) is what "mmake 
> foo.change_clean" does, except that it also deletes `.d', `.dep' and `.dv' 
> files (which is a nuisance if you just want to change grades).
> The change_clean targets are intended for when one wants to either change 
> grade or add intermodule optimisation.  For the former, you don't want to 
> delete the `.d' etc. files, since they are unchanged, and annoying to have 
> to rebuild.  For the latter (i.e. you just want to turn on intermodule 
> optimisation, nothing else) then a simple "mmake depend" suffices: when one 
> runs "mmake" again to rebuild, the optimisation files are generated, and 
> anything which depends on them is rebuilt --- which was why one wanted to 
> delete them in the first place.
> 
> So I guess I'm arguing that a target for when one turns on intermodule 
> optimisation is not particularly useful, while having one which deletes just 
> the grade-dependent files (and not the dependency files) is.

I agree; the `change_clean' target is a bit too specific to be useful.
I proposed removing it a few months ago and no-one objected.

> That said, I think the best name for a grade-dependent clean is "mmake 
> gradeclean", so I don't care if the `changeclean' target hangs around as is.
> (Yes, I'm happy to implement the gradeclean targets, because I'd use them 
> all the time.)

If you want to change the semantics for `change_clean' so that it doesn't
delete the dependency files, rename it as `gradeclean', and
modify the documentation which mentions `change_clean' to instead say
to use `mmake gradeclean; mmake depend' then I'd be happy with that.

But it's important to minimize the number of different targets, so that
users will be able to easily understand what they mean and easily remember
which target they need to use.  Is there a reason why `gradeclean' needs
to be different from `clean'?

-- 
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.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list