MAKEHELP.md 2.2 KB
Newer Older
1 2 3 4 5
Quick `make` guide for GHC
==========================

For a "Getting Started" guide, see:

6 7 8
  https://ghc.haskell.org/trac/ghc/wiki/Building/QuickStart
  https://ghc.haskell.org/trac/ghc/wiki/Building/Using
  https://ghc.haskell.org/trac/ghc/wiki/Building/StandardTargets
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

Common commands:

  - `make`

    Builds everything: ghc stages 1 and 2, all libraries and tools.

  - `make -j2`

    Parallel build: runs up to 2 commands at a time.

  - `cd <dir>; make`

    Builds everything in the given directory.

  - cd <dir>; make help

    Shows the targets available in <dir>

  - make install
29
  - make install-strip
30

31 32
    Installs GHC, libraries and tools under $(prefix). The install-strip
    variant strips executable files while installing them.
33 34 35 36 37 38 39

  - make sdist
  - make binary-dist

    Builds a source or binary distribution respectively

  - `make show VALUE=<var>`
40 41
  - `make show! VALUE=<var>`

42 43
    Show the value of make variable <var>. The show! variant works right after
    ./configure (it skips reading package-data.mk files).
44

45 46 47 48 49 50
  - make clean
  - make distclean
  - make maintainer-clean

    Various levels of cleaning: "clean" restores the tree to the
    state after "./configure", "distclean" restores to the state
Ben Gamari's avatar
Ben Gamari committed
51
    after "python3 boot", and maintainer-clean restores the tree to the
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
    completely clean checked-out state.

Using `make` in subdirectories
==============================

  - `make`

    Builds everything in this directory (including dependencies elsewhere
    in the tree, if necessary)

  - `make fast`

    The same as 'make', but omits some phases and does not
    recalculate dependencies.  Useful for saving time if you are sure
    the rest of the tree is up to date.

  - `make clean`
  - `make distclean`
  - `make maintainer-clean`

    Clean just this directory

  - `make html`
  - `make pdf`
  - `make ps`

    Make documentation in this directory (if any)

80 81
  - `make show VALUE=<var>`
  - `make show! VALUE=<var>`
82

83 84
    Show the value of make variable <var>. The show! variant works right after
    ./configure (it skips reading package-data.mk files).
85 86 87 88 89

  - `make <file>`

    Bring a particular file up to date, e.g. make dist/build/Module.o
    The name <file> is relative to the current directory