summaryrefslogtreecommitdiff
path: root/ghc/compiler/main/Main.hs
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-05-21 13:05:49 +0000
committersimonmar <unknown>2003-05-21 13:05:49 +0000
commit2d88d3766e1bfe78f6eb63c371cc256ebd91d056 (patch)
tree5ab686a237df6b25a3eeed77f9de2cec72e36038 /ghc/compiler/main/Main.hs
parentd9d000465e182da49260b15d477d688b63c12a17 (diff)
downloadhaskell-2d88d3766e1bfe78f6eb63c371cc256ebd91d056.tar.gz
[project @ 2003-05-21 13:05:49 by simonmar]
Restore the correct partitioning of command-line arguments into objects and compilation-manager inputs for --make mode, and restore a comment explaining the behaviour. Rev. 1.120 made some subtle changes to the semantics, in particular in cases where a file given on the command line is neither a source nor an object file. I believe the behaviour for one-shot mode has not changed. The behaviour for GHCi mode is now the same as --make mode (previous to rev. 1.120 it was subtly broken in this respect).
Diffstat (limited to 'ghc/compiler/main/Main.hs')
-rw-r--r--ghc/compiler/main/Main.hs29
1 files changed, 25 insertions, 4 deletions
diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs
index 23bbec1085..953bc87c4b 100644
--- a/ghc/compiler/main/Main.hs
+++ b/ghc/compiler/main/Main.hs
@@ -1,7 +1,7 @@
{-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
-----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.122 2003/05/21 12:38:36 simonmar Exp $
+-- $Id: Main.hs,v 1.123 2003/05/21 13:05:49 simonmar Exp $
--
-- GHC Driver program
--
@@ -198,9 +198,30 @@ main =
-- save the "initial DynFlags" away
saveDynFlags
- -- We split out the object files (.o, .dll) and add them
- -- to v_Ld_inputs for use by the linker
- let (objs, srcs) = partition objish_file fileish_args
+ let
+ {-
+ We split out the object files (.o, .dll) and add them
+ to v_Ld_inputs for use by the linker.
+
+ The following things should be considered compilation manager inputs:
+
+ - haskell source files (strings ending in .hs, .lhs or other
+ haskellish extension),
+
+ - module names (not forgetting hierarchical module names),
+
+ - and finally we consider everything not containing a '.' to be
+ a comp manager input, as shorthand for a .hs or .lhs filename.
+
+ Everything else is considered to be a linker object, and passed
+ straight through to the linker.
+ -}
+ looks_like_an_input m = isSourceFile m
+ || looksLikeModuleName m
+ || '.' `notElem` m
+
+ (srcs, objs) = partition looks_like_an_input fileish_args
+
mapM_ (add v_Ld_inputs) objs
---------------- Display banners and configuration -----------