Commit 90bf4766 authored by simonmar's avatar simonmar
Browse files

[project @ 2000-06-14 11:21:06 by simonmar]

Produce a gcc-like "ghc: no input files" when called with nothing to
do.  Note at the top of the file that we don't support the old
driver's "Enter your Haskell program..." nonsense.
parent 3aef7e29
......@@ -45,6 +45,7 @@ name = global (value) :: IORef (ty); \
-----------------------------------------------------------------------------
-- Differences vs. old driver:
-- No more "Enter your Haskell program, end with ^D (on a line of its own):"
-- consistency checking removed (may do this properly later)
-- removed -noC
-- no hi diffs (could be added later)
......@@ -114,6 +115,7 @@ data BarfKind
| WayCombinationNotSupported [WayName]
| PhaseFailed String ExitCode
| Interrupted
| NoInputFiles
deriving Eq
GLOBAL_VAR(prog_name, "ghc", String)
......@@ -138,6 +140,8 @@ showBarf (WayCombinationNotSupported ws)
= showString "combination not supported: "
. foldr1 (\a b -> a . showChar '/' . b)
(map (showString . wayName . lkupWay) ws)
showBarf (NoInputFiles)
= showString "no input files"
barfKindTc = mkTyCon "BarfKind"
......@@ -1041,13 +1045,16 @@ main =
then throwDyn MultipleSrcsOneOutput
else do
if null unknown_srcs && null phase_srcs
then throwDyn NoInputFiles
else do
-- if we have unknown files, and we're not doing linking, complain
-- (otherwise pass them through to the linker).
if not (null unknown_srcs) && not do_linking
then throwDyn (UnknownFileType (head unknown_srcs))
else do
let compileFile :: (Phase, String) -> IO String
compileFile (phase, src) = do
let (orig_base, _) = split_filename src
......
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