build.mk.sample 4.95 KB
Newer Older
1 2 3 4 5 6 7
# -----------------------------------------------------------------------------
# A Sample build.mk
#
# Uncomment one of the following BuildFlavour settings to get the desired
# overall build type, and then tweak the options in the relevant section
# below.

8
# -------- Build profiles -----------------------------------------------------
9 10
# Uncomment one of these to select a build profile below:

Simon Marlow's avatar
Simon Marlow committed
11
# Full build with max optimisation and everything enabled (very slow build)
12 13
#BuildFlavour = perf

14 15 16
# As above but build GHC using the LLVM backend
#BuildFlavour = perf-llvm

Simon Marlow's avatar
Simon Marlow committed
17
# Fast build with optimised libraries, no profiling (RECOMMENDED):
18 19
#BuildFlavour = quick

20 21 22
# Fast build with optimised libraries, no profiling, with LLVM:
#BuildFlavour = quick-llvm

Simon Marlow's avatar
Simon Marlow committed
23 24 25 26 27
# Even faster build.  NOT RECOMMENDED: the libraries will be
# completely unoptimised, so any code built with this compiler
# (including stage2) will run very slowly:
#BuildFlavour = quickest

28 29 30
# Profile the stage2 compiler:
#BuildFlavour = prof

31 32 33 34 35 36
# A development build, working on the stage 1 compiler:
#BuildFlavour = devel1

# A development build, working on the stage 2 compiler:
#BuildFlavour = devel2

37
# -------- Miscellaneous variables --------------------------------------------
Ian Lynagh's avatar
Ian Lynagh committed
38

39
# Set to V = 0 to get prettier build output.
40
# Please use V = 1 when reporting GHC bugs.
41 42 43 44 45 46 47 48 49 50 51 52
V = 1

# After stage 1 and the libraries have been built, you can uncomment this line:

#stage=2

# Then stage 1 will not be touched by the build system, until
# you comment the line again.  This is a useful trick for when you're
# working on stage 2 and want to freeze stage 1 and the libraries for
# a while.

GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
53

54
# ----------- A Performance/Distribution build --------------------------------
55 56 57

ifeq "$(BuildFlavour)" "perf"

58 59 60 61 62 63
# perf matches the default settings, repeated here for comparison:

SRC_HC_OPTS     = -O -H64m
GhcStage1HcOpts = -O -fasm
GhcStage2HcOpts = -O2 -fasm
GhcHcOpts       = -Rghc-timing
64
GhcLibHcOpts    = -O2
Ian Lynagh's avatar
Ian Lynagh committed
65
GhcLibWays     += p
66

67 68 69 70
ifeq "$(PlatformSupportsSharedLibs)" "YES"
GhcLibWays += dyn
endif

71
endif
72

73
# ---------------- Perf build using LLVM --------------------------------------
74 75 76 77 78 79 80 81 82 83

ifeq "$(BuildFlavour)" "perf-llvm"

SRC_HC_OPTS     = -O -H64m -fllvm
GhcStage1HcOpts = -O -fllvm
GhcStage2HcOpts = -O2 -fllvm
GhcHcOpts       = -Rghc-timing
GhcLibHcOpts    = -O2
GhcLibWays     += p

84 85 86
DYNAMIC_BY_DEFAULT   = NO
DYNAMIC_GHC_PROGRAMS = NO

87 88
endif

89
# -------- A Fast build -------------------------------------------------------
90

91 92
ifeq "$(BuildFlavour)" "quickest"

93 94 95 96 97 98 99 100 101
SRC_HC_OPTS        = -H64m -O0 -fasm
GhcStage1HcOpts    = -O -fasm
GhcStage2HcOpts    = -O0 -fasm
GhcLibHcOpts       = -O0 -fasm
SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO
Simon Marlow's avatar
Simon Marlow committed
102

103
endif
Simon Marlow's avatar
Simon Marlow committed
104

105
# -------- A Fast build with optimised libs -----------------------------------
106

107
ifeq "$(BuildFlavour)" "quick"
108

109 110 111 112 113 114 115 116 117
SRC_HC_OPTS        = -H64m -O0 -fasm
GhcStage1HcOpts    = -O -fasm
GhcStage2HcOpts    = -O0 -fasm
GhcLibHcOpts       = -O -fasm
SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO
118

119
endif
120

121
# -------- A Fast build with optimised libs using LLVM ------------------------
122 123 124 125 126 127 128 129 130 131 132 133 134

ifeq "$(BuildFlavour)" "quick-llvm"

SRC_HC_OPTS        = -H64m -O0 -fllvm
GhcStage1HcOpts    = -O -fllvm
GhcStage2HcOpts    = -O0 -fllvm
GhcLibHcOpts       = -O -fllvm
SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO

135 136 137
DYNAMIC_BY_DEFAULT   = NO
DYNAMIC_GHC_PROGRAMS = NO

138 139
endif

140
# -------- Profile the stage2 compiler ----------------------------------------
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

ifeq "$(BuildFlavour)" "prof"

SRC_HC_OPTS        = -H64m -O0 -fasm
GhcStage1HcOpts    = -O -fasm
GhcStage2HcOpts    = -O -fasm
GhcLibHcOpts       = -O -fasm

GhcLibWays         += p
GhcProfiled        = YES

SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO

endif

160
# -------- A Development build (stage 1) --------------------------------------
161 162 163

ifeq "$(BuildFlavour)" "devel1"

164 165
SRC_HC_OPTS        = -H64m -O -fasm
GhcLibHcOpts       = -O -dcore-lint
166 167 168 169 170 171 172
GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
GhcStage2HcOpts    = -Rghc-timing -O -fasm
SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO
173
LAX_DEPENDENCIES   = YES
174

175 176
endif

177
# -------- A Development build (stage 2) --------------------------------------
178 179 180

ifeq "$(BuildFlavour)" "devel2"

181 182
SRC_HC_OPTS        = -H64m -O -fasm
GhcLibHcOpts       = -O -dcore-lint
183 184 185 186 187 188 189
GhcStage1HcOpts    = -Rghc-timing -O -fasm
GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO
190
LAX_DEPENDENCIES   = YES
191 192 193

endif

194 195
# -----------------------------------------------------------------------------
# Other settings that might be useful
196

197 198
# NoFib settings
NoFibWays =
199
STRIP_CMD = :
200