[MLton-commit] r7143

Matthew Fluet fluet at mlton.org
Sun Jun 14 15:27:16 PDT 2009


Fix name generation of .o files.
----------------------------------------------------------------------

U   mlton/trunk/mlton/main/main.fun

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/main/main.fun
===================================================================
--- mlton/trunk/mlton/main/main.fun	2009-06-14 18:17:43 UTC (rev 7142)
+++ mlton/trunk/mlton/main/main.fun	2009-06-14 22:27:15 UTC (rev 7143)
@@ -1266,13 +1266,12 @@
                         in
                            ()
                         end
-                  fun mkOutputO (c: Counter.t, _): File.t =
+                  fun mkOutputO (c: Counter.t, input: File.t): File.t =
                      if stop = Place.O orelse !keepO
                         then
-                           if !keepGenerated
-                              orelse start = Place.Generated
+                           if File.dirOf input = File.dirOf (maybeOutBase ".o")
                               then
-                                 maybeOutBase ".o"
+                                 concat [File.base input, ".o"]
                               else
                                  maybeOutBase
                                     (concat [".",
@@ -1358,7 +1357,7 @@
                               val _ = Int.inc r
                               val file = (if !keepGenerated
                                              orelse stop = Place.Generated
-                                             then suffix
+                                             then maybeOutBase
                                           else temp) suf
                               val _ = List.push (outputs, file)
                               val out = Out.openOut file




More information about the MLton-commit mailing list