[project @ 2005-05-16 13:47:57 by simonmar]
authorsimonmar <unknown>
Mon, 16 May 2005 13:47:58 +0000 (13:47 +0000)
committersimonmar <unknown>
Mon, 16 May 2005 13:47:58 +0000 (13:47 +0000)
commit34c2b1b2cdc009b62402bd1c31ffc1ae17df8969
treea6dfa877f015ffcfc9ec88cc8cc490eae2f72450
parentafdca09fe9adce721be8f42fd40b5838b3243b8c
[project @ 2005-05-16 13:47:57 by simonmar]
Implement -x <suffix> flag to override the suffix of a filename for
the purposes of determinig how it should be compiled.  The usage is
similar to gcc, except that we just use a suffix rather than a name
for the language. eg.

   ghc -c -x hs hello.blah

will pretend hello.blah is a .hs file.  Another possible use is -x
hspp, which skips preprocessing.

This works for one-shot compilation, --make, GHCi, and ghc -e.  The
original idea was to make it possible to use runghc on a file that
doesn't end in .hs, so changes to runghc will follow.

Also, I made it possible to specify .c files and other kinds of files
on the --make command line; these will be compiled to objects as
normal and linked into the final executable.

GHC API change: I had to extend the Target type to include an optional
start phase, and also GHC.guessTarget now takes a (Maybe Phase) argument.

I thought this would be half an hour, in fact it took half a day, and
I still haven't documented it.  Sigh.
ghc/compiler/ghci/InteractiveUI.hs
ghc/compiler/main/DriverMkDepend.hs
ghc/compiler/main/DriverPhases.hs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/Finder.lhs
ghc/compiler/main/GHC.hs
ghc/compiler/main/HscTypes.lhs
ghc/compiler/main/Main.hs
ghc/compiler/utils/Util.lhs