Merge branch 'master' of http://git.haskell.org/ghc
[ghc.git] / mk / build.mk.sample
1 # -----------------------------------------------------------------------------
2 # A Sample build.mk
3 #
4 # Uncomment one of the following BuildFlavour settings to get the desired
5 # overall build type, and then tweak the options in the relevant section
6 # below.
7
8 # -------- Build profiles -----------------------------------------------------
9 # Uncomment one of these to select a build profile below:
10
11 # Full build with max optimisation and everything enabled (very slow build)
12 #BuildFlavour = perf
13
14 # As above but build GHC using the LLVM backend
15 #BuildFlavour = perf-llvm
16
17 # Perf build configured for a cross-compiler
18 #BuildFlavour = perf-cross
19
20 # Fast build with optimised libraries, no profiling (RECOMMENDED):
21 #BuildFlavour = quick
22
23 # Fast build with optimised libraries, no profiling, with LLVM:
24 #BuildFlavour = quick-llvm
25
26 # Fast build configured for a cross compiler
27 #BuildFlavour  = quick-cross
28
29 # Even faster build.  NOT RECOMMENDED: the libraries will be
30 # completely unoptimised, so any code built with this compiler
31 # (including stage2) will run very slowly:
32 #BuildFlavour = quickest
33
34 # Profile the stage2 compiler:
35 #BuildFlavour = prof
36
37 # A development build, working on the stage 1 compiler:
38 #BuildFlavour = devel1
39
40 # A development build, working on the stage 2 compiler:
41 #BuildFlavour = devel2
42
43 # A build with max optimisation that still builds the stage2 compiler
44 # quickly. Compiled code will be the same as with "perf". Programs
45 # will compile more slowly.
46 #BuildFlavour = bench
47
48 # As above but build GHC using the LLVM backend
49 #BuildFlavour = bench-llvm
50
51 # Bench build configured for a cross-compiler
52 #BuildFlavour = bench-cross
53
54 # -------- Miscellaneous variables --------------------------------------------
55
56 # Set to V = 0 to get prettier build output.
57 # Please use V = 1 when reporting GHC bugs.
58 V = 1
59
60 # After stage 1 and the libraries have been built, you can uncomment this line:
61
62 #stage=2
63
64 # Then stage 1 will not be touched by the build system, until
65 # you comment the line again.  This is a useful trick for when you're
66 # working on stage 2 and want to freeze stage 1 and the libraries for
67 # a while.
68
69 # Uncomment the following line to enable building DPH
70 #BUILD_DPH=YES
71
72 GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
73
74 # ----------- A Performance/Distribution build --------------------------------
75
76 ifeq "$(BuildFlavour)" "perf"
77
78 # perf matches the default settings, repeated here for comparison:
79
80 SRC_HC_OPTS     = -O -H64m
81 GhcStage1HcOpts = -O -fasm
82 GhcStage2HcOpts = -O2 -fasm
83 GhcHcOpts       = -Rghc-timing
84 GhcLibHcOpts    = -O2
85 GhcLibWays     += p
86
87 ifeq "$(PlatformSupportsSharedLibs)" "YES"
88 GhcLibWays += dyn
89 endif
90
91 endif
92
93 # ---------------- Perf build using LLVM --------------------------------------
94
95 ifeq "$(BuildFlavour)" "perf-llvm"
96
97 SRC_HC_OPTS     = -O -H64m -fllvm
98 GhcStage1HcOpts = -O -fllvm
99 GhcStage2HcOpts = -O2 -fllvm
100 GhcHcOpts       = -Rghc-timing
101 GhcLibHcOpts    = -O2
102 GhcLibWays     += p
103
104 endif
105
106 # ------- A Perf build configured for cross-compilation ----------------------
107
108 ifeq "$(BuildFlavour)" "perf-cross"
109
110 SRC_HC_OPTS     = -O -H64m -fllvm
111 GhcStage1HcOpts = -O2
112 GhcStage2HcOpts = -O2 -fllvm
113 GhcHcOpts       = -Rghc-timing
114 GhcLibHcOpts    = -O2
115 GhcLibWays     += p
116 INTEGER_LIBRARY    = integer-simple
117 Stage1Only         = YES
118
119 HADDOCK_DOCS       = NO
120 BUILD_DOCBOOK_HTML = NO
121 BUILD_DOCBOOK_PS   = NO
122 BUILD_DOCBOOK_PDF  = NO
123
124 DYNAMIC_BY_DEFAULT   = NO
125 DYNAMIC_GHC_PROGRAMS = NO
126
127 endif
128
129 # -------- A Fast build -------------------------------------------------------
130
131 ifeq "$(BuildFlavour)" "quickest"
132
133 SRC_HC_OPTS        = -H64m -O0 -fasm
134 GhcStage1HcOpts    = -O -fasm
135 GhcStage2HcOpts    = -O0 -fasm
136 GhcLibHcOpts       = -O0 -fasm
137 SplitObjs          = NO
138 HADDOCK_DOCS       = NO
139 BUILD_DOCBOOK_HTML = NO
140 BUILD_DOCBOOK_PS   = NO
141 BUILD_DOCBOOK_PDF  = NO
142
143 endif
144
145 # -------- A Fast build with optimised libs -----------------------------------
146
147 ifeq "$(BuildFlavour)" "quick"
148
149 SRC_HC_OPTS        = -H64m -O0 -fasm
150 GhcStage1HcOpts    = -O -fasm
151 GhcStage2HcOpts    = -O0 -fasm
152 GhcLibHcOpts       = -O -fasm
153 SplitObjs          = NO
154 HADDOCK_DOCS       = NO
155 BUILD_DOCBOOK_HTML = NO
156 BUILD_DOCBOOK_PS   = NO
157 BUILD_DOCBOOK_PDF  = NO
158
159 endif
160
161 # -------- A Fast build with optimised libs using LLVM ------------------------
162
163 ifeq "$(BuildFlavour)" "quick-llvm"
164
165 SRC_HC_OPTS        = -H64m -O0 -fllvm
166 GhcStage1HcOpts    = -O -fllvm
167 GhcStage2HcOpts    = -O0 -fllvm
168 GhcLibHcOpts       = -O -fllvm
169 SplitObjs          = NO
170 HADDOCK_DOCS       = NO
171 BUILD_DOCBOOK_HTML = NO
172 BUILD_DOCBOOK_PS   = NO
173 BUILD_DOCBOOK_PDF  = NO
174
175 endif
176
177 # -------- A Fast build configured for cross-compilation ----------------------
178
179 ifeq "$(BuildFlavour)" "quick-cross"
180
181 SRC_HC_OPTS        = -H64m -O0
182 GhcStage1HcOpts    = -O
183 GhcStage2HcOpts    = -O0 -fllvm
184 GhcLibHcOpts       = -O -fllvm
185 SplitObjs          = NO
186 HADDOCK_DOCS       = NO
187 BUILD_DOCBOOK_HTML = NO
188 BUILD_DOCBOOK_PS   = NO
189 BUILD_DOCBOOK_PDF  = NO
190 INTEGER_LIBRARY    = integer-simple
191 Stage1Only         = YES
192
193 DYNAMIC_BY_DEFAULT   = NO
194 DYNAMIC_GHC_PROGRAMS = NO
195
196 endif
197
198 # -------- Profile the stage2 compiler ----------------------------------------
199
200 ifeq "$(BuildFlavour)" "prof"
201
202 SRC_HC_OPTS        = -H64m -O0 -fasm
203 GhcStage1HcOpts    = -O -fasm
204 GhcStage2HcOpts    = -O -fasm
205 GhcLibHcOpts       = -O -fasm
206
207 GhcLibWays         += p
208 GhcProfiled        = YES
209
210 SplitObjs          = NO
211 HADDOCK_DOCS       = NO
212 BUILD_DOCBOOK_HTML = NO
213 BUILD_DOCBOOK_PS   = NO
214 BUILD_DOCBOOK_PDF  = NO
215
216 endif
217
218 # -------- A Development build (stage 1) --------------------------------------
219
220 ifeq "$(BuildFlavour)" "devel1"
221
222 SRC_HC_OPTS        = -H64m -O -fasm
223 GhcLibHcOpts       = -O -dcore-lint
224 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
225 GhcStage2HcOpts    = -Rghc-timing -O -fasm
226 SplitObjs          = NO
227 HADDOCK_DOCS       = NO
228 BUILD_DOCBOOK_HTML = NO
229 BUILD_DOCBOOK_PS   = NO
230 BUILD_DOCBOOK_PDF  = NO
231 LAX_DEPENDENCIES   = YES
232
233 endif
234
235 # -------- A Development build (stage 2) --------------------------------------
236
237 ifeq "$(BuildFlavour)" "devel2"
238
239 SRC_HC_OPTS        = -H64m -O -fasm
240 GhcLibHcOpts       = -O -dcore-lint
241 GhcStage1HcOpts    = -Rghc-timing -O -fasm
242 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
243 SplitObjs          = NO
244 HADDOCK_DOCS       = NO
245 BUILD_DOCBOOK_HTML = NO
246 BUILD_DOCBOOK_PS   = NO
247 BUILD_DOCBOOK_PDF  = NO
248 LAX_DEPENDENCIES   = YES
249
250 endif
251
252 # -------- A bench build with optimised libs -----------------------------------
253
254 ifeq "$(BuildFlavour)" "bench"
255
256 SRC_HC_OPTS        = -O -H64m
257 GhcStage1HcOpts    = -O -fasm
258 GhcStage2HcOpts    = -O0 -fasm
259 GhcLibHcOpts       = -O2 -fasm
260 SplitObjs          = NO
261 HADDOCK_DOCS       = NO
262 BUILD_DOCBOOK_HTML = NO
263 BUILD_DOCBOOK_PS   = NO
264 BUILD_DOCBOOK_PDF  = NO
265
266 endif
267
268 # ---------------- Bench build using LLVM --------------------------------------
269
270 ifeq "$(BuildFlavour)" "bench-llvm"
271
272 SRC_HC_OPTS        = -O -H64m
273 GhcStage1HcOpts    = -O -fllvm
274 GhcStage2HcOpts    = -O0 -fllvm
275 GhcLibHcOpts       = -O2 -fllvm
276 SplitObjs          = NO
277 HADDOCK_DOCS       = NO
278 BUILD_DOCBOOK_HTML = NO
279 BUILD_DOCBOOK_PS   = NO
280 BUILD_DOCBOOK_PDF  = NO
281
282 endif
283
284 # ------- A Bench build configured for cross-compilation ----------------------
285
286 ifeq "$(BuildFlavour)" "bench-cross"
287
288 SRC_HC_OPTS        = -O -H64m
289 GhcStage1HcOpts    = -O -fasm
290 GhcStage2HcOpts    = -O0 -fasm
291 GhcLibHcOpts       = -O2 -fasm
292 SplitObjs          = NO
293 INTEGER_LIBRARY    = integer-simple
294 Stage1Only         = YES
295 HADDOCK_DOCS       = NO
296 BUILD_DOCBOOK_HTML = NO
297 BUILD_DOCBOOK_PS   = NO
298 BUILD_DOCBOOK_PDF  = NO
299
300 DYNAMIC_BY_DEFAULT   = NO
301 DYNAMIC_GHC_PROGRAMS = NO
302
303 endif
304
305 # -----------------------------------------------------------------------------
306 # Other settings that might be useful
307
308 # NoFib settings
309 NoFibWays =
310 STRIP_CMD = :
311