[m-dev.] For review: Simplify specification of some per-program flags

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jul 1 17:29:04 AEST 1999


On 01-Jul-1999, Warwick Harvey <wharvey at cs.monash.edu.au> wrote:
> Anyway, with the GRADEFLAGS stuff, if one does the substitution for both the 
> `$@' and `$*' variables, one gets the grade flags repeated in the call to 
> `c2init', since both match.  This is probably harmless.  However, I'm going 
> to argue that whenever `$(patsubst %_init.c,%,$@)' gives you `foo', 
> `$(patsubst %_init,%,$*)' will also give you `foo' (`_init.c' files are only 
> ever built by implicit rules, right?), so the substitution is only necessary 
> for the latter.

No, `_init.c' files are almost always generated by explicit rules.
The explicit rules are of course themselves automatically generated,
 by `mmake depend', but they're still explicit as far as Make is concerned,
and so `$*' will not be set.

For example, the following is from compiler/Mercury/deps/mercury_compile.dep:

 | 	Mercury/cs/mercury_compile_init.c : Mercury/deps/mercury_compile.dep
 | 		$(C2INIT) $(ALL_GRADEFLAGS) $(ALL_C2INITFLAGS) \
 | 		$(mercury_compile.init_cs) > Mercury/cs/mercury_compile_init.c

So I suggest you go with the harmless repetition.

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