X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2Fghc-usage.txt;h=e95d5846b9c327e28ae913debc35f752fa54516b;hb=28a464a75e14cece5db40f2765a29348273ff2d2;hp=95a8a9e6c85f508ea1b2ef2fbccb87851addc878;hpb=0a423b55057fabe52df3a979d42dc226ff5f7c86;p=ghc-hetmet.git diff --git a/ghc/driver/ghc-usage.txt b/ghc/driver/ghc-usage.txt index 95a8a9e..e95d584 100644 --- a/ghc/driver/ghc-usage.txt +++ b/ghc/driver/ghc-usage.txt @@ -1,10 +1,20 @@ -Use of the Glasgow Haskell Compiler driver: +Usage: $$ [command-line-options-and-input-files] ------------------------------------------------------------------------- -This driver ($$) guides each input file through (some of the) -possible phases of a compilation: +To compile and link a complete Haskell program, run the compiler like +so: + + $$ --make Main + +where the module Main is in a file named Main.hs (or Main.lhs) in the +current directory. The other modules in the program will be located +and compiled automatically, and the linked program will be placed in +the file `a.out' (or `Main.exe' on Windows). + +Alternatively, $$ can be used to compile files individually. Each +input file is guided through (some of the) possible phases of a +compilation: - unlit: extract code from a "literate program" - hscpp: run code through the C pre-processor (if -cpp flag given) @@ -15,19 +25,17 @@ possible phases of a compilation: For each input file, the phase to START with is determined by the file's suffix: - - .lhs literate Haskell: unlit - - .hs illiterate Haskell: hsc - - .hc C from the Haskell compiler: gcc - - .c C not from the Haskell compiler: gcc - - .s assembly language: as - - other passed directly to the linker: ld -If no files are given on the command line, input is taken from -standard input, and processing is as for an .hs file. (All output is -to stdout or stderr, however). + - .lhs literate Haskell unlit + - .hs plain Haskell ghc + - .hc C from the Haskell compiler gcc + - .c C not from the Haskell compiler gcc + - .s assembly language as + - other passed directly to the linker ld The phase at which to STOP processing is determined by a command-line option: + -E stop after generating preprocessed, de-litted Haskell (used in conjunction with -cpp) -C stop after generating C (.hc output) @@ -36,22 +44,22 @@ option: Other commonly-used options are: - -O An `optimising' package of compiler flags, for faster code - - -prof Compile for cost-centre profiling - (add -auto for automagic cost-centres on top-level functions) + -v[n] Control verbosity (n is 0--5, normal verbosity level is 1, + -v alone is equivalent to -v3) -fglasgow-exts Allow Glasgow extensions (unboxed types, etc.) - -H14m Increase compiler's heap size + -O An `optimising' package of compiler flags, for faster code + + -prof Compile for cost-centre profiling + (add -auto-all for automagic cost-centres on all + top-level functions) - -M Output the Makefile rules recording the - dependencies of a list of Haskell files. - (ghc driver script calls upon the help of a - compatible mkdependHS script to do the actual - processing) + -H14m Increase compiler's heap size (might make compilation + faster, especially on large source files). -The User's Guide has more information about GHC's *many* options. + -M Output Makefile rules recording the + dependencies of a list of Haskell files. Given the above, here are some TYPICAL invocations of $$: @@ -63,4 +71,10 @@ Given the above, here are some TYPICAL invocations of $$: % $$ -C -H16m Foo.hs # compile Haskell-produced C (.hc) to assembly language: % $$ -S Foo.hc + +The User's Guide has more information about GHC's *many* options. An +online copy can be found here: + + http://www.haskell.org/ghc/documentation.html + ------------------------------------------------------------------------