Commit 2d88d376 authored by simonmar's avatar simonmar
Browse files

[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).
parent d9d00046
{-# 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
-- 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
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 -----------
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment