~ chicken-core (chicken-5) 31bc076a1510fbea02be0262e2f2e0cc16e91d17


commit 31bc076a1510fbea02be0262e2f2e0cc16e91d17
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Fri Apr 7 18:03:10 2017 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Fri Apr 7 18:03:10 2017 +0200

    csc: use target-filename for output file if in compile-only mode

diff --git a/csc.scm b/csc.scm
index c3b545f4..622bd4d7 100644
--- a/csc.scm
+++ b/csc.scm
@@ -873,7 +873,11 @@ EOF
   (let ((ofiles '()))
     (for-each
      (lambda (f)
-       (let ((fo (pathname-replace-extension f object-extension)))
+       (let ((fo (if (and compile-only
+                          target-filename
+                          (= 1 (length c-files)))
+                     target-filename
+                     (pathname-replace-extension f object-extension))))
 	 (when (member fo object-files)
 	   (stop "object file generated from `~a' will overwrite explicitly given object file `~a'"
 		 f fo))
Trap