[m-dev.] cvs diff: EXTRA_* flags

Tyson Richard DOWD trd at hydra.cs.mu.oz.au
Tue Mar 18 12:36:01 AEDT 1997


> 
> Tyson Richard DOWD, you wrote:
> > 
> > Okay, here we go again. Fergus, is this what you intended?
> 
> Yes.  The changes to the code are exactly what I intended.
> But the documentation should be improved.
> 

===================================================================

Estimated hours taken: 2

Use EXTRA_* environment variables for setting flags.

doc/user_guide.texi:
	Document that EXTRA_* variables can be used for setting flags
	when mmake is being used. Document the commonly used mmake
	variables.

scripts/Mmake.vars.in:
	Set *FLAGS variables according to EXTRA_*FLAGS.


Index: doc/user_guide.texi
===================================================================
RCS file: /home/staff/zs/imp/mercury/doc/user_guide.texi,v
retrieving revision 1.82
diff -u -r1.82 user_guide.texi
--- user_guide.texi	1997/02/01 08:38:31	1.82
+++ user_guide.texi	1997/03/18 00:44:38
@@ -615,8 +615,47 @@
 
 @end table
 
-The variables used by the builtin rules are defined in
- at file{@var{prefix}/lib/mercury/mmake/Mmake.vars}.
+The variables used by the builtin rules (and their default values) are
+defined in @file{@var{prefix}/lib/mercury/mmake/Mmake.vars}, however
+these may be overridden by user @samp{Mmake} files. Some of the more
+useful variables are:
+
+ at table @code
+
+ at item MC
+The executable that invokes the Mercury compiler.
+
+ at item MCFLAGS and EXTRA_MCFLAGS
+Flags to pass to the Mercury compiler.
+
+ at item MGNUC
+The executable that invokes the C compiler.
+
+ at item MGNUCFLAGS and EXTRA_MGNUCFLAGS
+Flags to pass to the C compiler.
+
+ at item ML
+The executable that invokes the linker.
+
+ at item MLFLAGS and EXTRA_MLFLAGS
+Flags to pass to the linker.
+
+ at end table
+
+Other variables also exist - see
+ at file{@var{prefix}/lib/mercury/mmake/Mmake.vars} for a complete list. 
+
+If you wish to temporarily change the flags passed to an executable,
+rather than setting the various @samp{FLAGS} variables directly, one can
+supply a @samp{EXTRA_} variable. When defining a @samp{FLAGS} option
+directly (in your own @samp{Mmake} file), it is recommended you include
+the @samp{EXTRA_} version at the end. This is particularly intended for
+use where a shell script needs to call mmake and add an extra parameter,
+without interfering with the flag settings in the @samp{Mmake} file.
+
+ at example
+MCFLAGS = -O6 $(EXTRA_MCFLAGS)
+ at end example
 
 Note that since Mmake is built on top of Make or GNU Make,
 you can make use of the features supported by the underlying Make.
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.5
diff -u -r1.5 Mmake.vars.in
--- Mmake.vars.in	1996/09/11 08:58:16	1.5
+++ Mmake.vars.in	1997/03/17 00:34:55
@@ -29,7 +29,7 @@
 MCI		= $(MC) --make-interface
 MCSI		= $(MC) --make-short-interface
 MCOI		= $(MC) --make-optimization-interface
-MCFLAGS		=
+MCFLAGS		= $(EXTRA_MCFLAGS)
 MCIFLAGS	= $(MCFLAGS)
 MCSIFLAGS	= $(MCFLAGS)
 MCOIFLAGS	= $(MCFLAGS)
@@ -42,27 +42,27 @@
 # the options which should be passed to them.
 #
 MOD2C		= mod2c
-MOD2CFLAGS	= 
+MOD2CFLAGS	= $(EXTRA_MOD2CFLAGS)
 MOD2H		= mod2h
-MOD2HFLAGS	= 
+MOD2HFLAGS	= $(EXTRA_MOD2HFLAGS)
 C2INIT		= c2init
-C2INITFLAGS	=
+C2INITFLAGS	= $(EXTRA_C2INITFLAGS)
 MGNUC		= mgnuc
-MGNUCFLAGS	=
+MGNUCFLAGS	= $(EXTRA_MGNUCFLAGS) $(EXTRA_CFLAGS) 
 ML		= ml
-MLFLAGS		=
+MLFLAGS		= $(EXTRA_MLFLAGS)
 MNC		= mnc
-MNCFLAGS	=
+MNCFLAGS	= $(EXTRA_MNCFLAGS)
 MNL		= mnl
-MNLFLAGS	=
+MNLFLAGS	= $(EXTRA_MNLFLAGS)
 MNP		= mnp
-MNPFLAGS	=
+MNPFLAGS	= $(EXTRA_MNPFLAGS)
 MSC		= msc
-MSCFLAGS	=
+MSCFLAGS	= $(EXTRA_MSCFLAGS)
 MSL		= msl
-MSLFLAGS	=
+MSLFLAGS	= $(EXTRA_MSLFLAGS)
 MSP		= msp
-MSPFLAGS	=
+MSPFLAGS	= $(EXTRA_MSPFLAGS)
 
 # $(CFLAGS_FOR_PIC) is passed to the C compiler when creating `.pic_o' files
 # (We use `.pic_o' as the extension for `.o' files that must have

-- 
       Tyson Dowd           # "Well, let's just say, 'if your VCR is
                            #  still blinking 12:00, you don't
     trd at cs.mu.oz.au        #  want Linux'". 
http://www.cs.mu.oz.au/~trd #  --Bruce Perens, Debian's Fearless Leader



More information about the developers mailing list