Skip to content
  • Simon Marlow's avatar
    [project @ 2005-05-16 13:47:57 by simonmar] · 34c2b1b2
    Simon Marlow authored
    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.
    34c2b1b2