[m-rev.] diff: fix sub-module build problem

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 16 02:22:32 AEDT 2001


On 15-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> Estimated hours taken: 1
> Branches: main
> 
> When compiling a module which contains a nested sub-module you must
> build the .int0 file before attempting to build the .int file.  This is
> because while building the .int file you will need the .int0 file to
> build the .int file of the nested sub-module.
> 
> compiler/modules.m:
>     When generating the .d file for a nested submodule.  Add the rule
>         <sourcefilename>.date : <sourcefilename>.int0
>     where <sourcefilename> is the name of the sourcefile which contains
>     the nested sub-module.

This change won't work correctly with `--use-subdirs'.

> +++ compiler/modules.m	15 Nov 2001 14:41:43 -0000
> @@ -1885,7 +1885,9 @@
>  			string__remove_suffix(SourceFileName, ".m",
>  				SourceFileBase)
>  		->
> -			string__append(SourceFileBase, ".err", ErrFileName)
> +			ErrFileName = SourceFileBase ++ ".err",
> +			SourceDate = SourceFileBase ++ ".date",
> +			SourceInt0 = SourceFileBase ++ ".int0"

That's not the right way to calculate the names of the `.date'
and `.int0' files.  (The `ErrFileName' is a special case, since it
always resides in the current directory, even with --use-subdirs.)

I don't know off-hand what the right solution is, but you might possibly
want to consider using `module_name_to_file_name' or something along
those lines.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list