[m-dev.] Re: Mmake bug in rotd-2000-06-27 ?

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jul 27 20:32:20 AEST 2000


In mail to mercury-bugs at cs.mu.oz.au, on 26-Jul-2000,
Ralph Becket <rbeck at microsoft.com> wrote:
> I just installed (stable) rotd-2000-06-27 on my home machine
> (Windows 98, Cygwin-b20) and observed the following on a
> small test file:
> 
> $ mkdir Mercury
> $ mmake foo.depend
> mmc --generate-dependencies --high-level-code     --use-subdirs    foo
> # the following mkdirs work around a bug in GNU Make
> [ -d Mercury/dates ] || mkdir Mercury/dates
> [ -d Mercury/date0s ] || mkdir Mercury/date0s
> [ -d Mercury/date3s ] || mkdir Mercury/date3s
> [ -d Mercury/optdates ] || mkdir Mercury/optdates
> $ mmake foo
> rm -f Mercury/cs/foo.c
> mmc --compile-to-c --high-level-code     --use-subdirs    foo.m > foo.err
> 2>&1
> mgnuc --high-level-code            -I. -c Mercury/cs/foo.c -o
> Mercury/os/foo.o
> Assembler messages:
> FATAL: Can't create Mercury/os/foo.o: No such file or directory
> make: *** [Mercury/os/foo.o] Error 1

The following patch fixes the bug described above.
I'll go ahead and commit this one.

----------

Estimated hours taken: 1.5

compiler/modules.m:
	Fix a bug introduced in petdr's change to use `$O' rather than `.o'
	in the generated Mmakefiles: we need to make sure that the `*_init.$O'
	files go in the `os' directory rather than the `$Os' [sic] directory.

Workspace: /home/pgrad/fjh/ws/hg
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.130
diff -u -d -r1.130 modules.m
--- compiler/modules.m	2000/06/22 08:50:20	1.130
+++ compiler/modules.m	2000/07/27 10:09:40
@@ -645,8 +645,8 @@
 		% we need to handle a few cases specially
 		%
 		{
-			( Ext = ".dir/*.$O"
-			; Ext = ".dir/*.o"
+			( Ext = ".dir/*.o"
+			; Ext = ".dir/*.$O"
 			)
 
 		->
@@ -655,15 +655,19 @@
 			% .$O and .pic_o files need to go in the
 			% same directory, so that using
 			% .$(EXT_FOR_PIC_OBJECTS) will work.
-			( Ext = ".$O"
-			; Ext = ".o"
+			( Ext = ".o"
+			; Ext = ".$O"
 			; Ext = ".pic_o"
 			; Ext = "$(EXT_FOR_PIC_OBJECTS)"
+			; Ext = "_init.o"
+			; Ext = "_init.$O"
+			; Ext = "_init.pic_o"
+			; Ext = "_init.$(EXT_FOR_PIC_OBJECTS)"
 			)
 		->
 			SubDirName = "os"
 		;
-			% _init.c, _init.s, _init.$O etc. files
+			% _init.c, _init.s, _init.o etc. files
 			% go in the cs, ss, os etc. subdirectories
 			string__append("_init.", ExtName, Ext)
 		->

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