T4945 is working again
[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 # Should all enabled warnings (see mk/warnings.mk) be turned into errors?
61 #WERROR=-Werror
62
63 # After stage 1 and the libraries have been built, you can uncomment this line:
64
65 #stage=2
66
67 # Then stage 1 will not be touched by the build system, until
68 # you comment the line again.  This is a useful trick for when you're
69 # working on stage 2 and want to freeze stage 1 and the libraries for
70 # a while.
71
72 # Build the "extra" packages (see ./packages). This enables more tests. See:
73 # https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Running#AdditionalPackages
74 #BUILD_EXTRA_PKGS=YES
75
76 # Uncomment the following line to enable building DPH
77 #BUILD_DPH=YES
78
79 # Uncomment the following to force `integer-gmp` to use the in-tree GMP 5.0.4
80 # (other sometimes useful configure-options: `--with-gmp-{includes,libraries}`)
81 #libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp
82
83 # ----------- A Performance/Distribution build --------------------------------
84
85 ifeq "$(BuildFlavour)" "perf"
86
87 # perf matches the default settings, repeated here for comparison:
88
89 SRC_HC_OPTS        = -O -H64m
90 GhcStage1HcOpts    = -O
91 GhcStage2HcOpts    = -O2
92 GhcLibHcOpts       = -O2
93 BUILD_PROF_LIBS    = YES
94 #SplitObjs
95 #HADDOCK_DOCS
96 #BUILD_DOCBOOK_HTML
97 #BUILD_DOCBOOK_PS
98 #BUILD_DOCBOOK_PDF
99
100 endif
101
102 # ---------------- Perf build using LLVM --------------------------------------
103
104 ifeq "$(BuildFlavour)" "perf-llvm"
105
106 SRC_HC_OPTS        = -O -H64m -fllvm
107 GhcStage1HcOpts    = -O -fllvm
108 GhcStage2HcOpts    = -O2 -fllvm
109 GhcLibHcOpts       = -O2
110 BUILD_PROF_LIBS    = YES
111 #SplitObjs
112 #HADDOCK_DOCS
113 #BUILD_DOCBOOK_HTML
114 #BUILD_DOCBOOK_PS
115 #BUILD_DOCBOOK_PDF
116
117 endif
118
119 # ------- A Perf build configured for cross-compilation ----------------------
120
121 ifeq "$(BuildFlavour)" "perf-cross"
122
123 SRC_HC_OPTS        = -O -H64m -fllvm
124 GhcStage1HcOpts    = -O2
125 GhcStage2HcOpts    = -O2 -fllvm
126 GhcLibHcOpts       = -O2
127 BUILD_PROF_LIBS    = YES
128 #SplitObjs
129 HADDOCK_DOCS       = NO
130 BUILD_DOCBOOK_HTML = NO
131 BUILD_DOCBOOK_PS   = NO
132 BUILD_DOCBOOK_PDF  = NO
133
134 INTEGER_LIBRARY      = integer-simple
135 Stage1Only           = YES
136 DYNAMIC_BY_DEFAULT   = NO
137 DYNAMIC_GHC_PROGRAMS = NO
138
139 endif
140
141 # -------- A Fast build -------------------------------------------------------
142
143 ifeq "$(BuildFlavour)" "quickest"
144
145 SRC_HC_OPTS        = -H64m -O0
146 GhcStage1HcOpts    = -O
147 GhcStage2HcOpts    = -O0
148 GhcLibHcOpts       = -O0
149 BUILD_PROF_LIBS    = NO
150 SplitObjs          = NO
151 HADDOCK_DOCS       = NO
152 BUILD_DOCBOOK_HTML = NO
153 BUILD_DOCBOOK_PS   = NO
154 BUILD_DOCBOOK_PDF  = NO
155
156 endif
157
158 # -------- A Fast build with optimised libs -----------------------------------
159
160 ifeq "$(BuildFlavour)" "quick"
161
162 SRC_HC_OPTS        = -H64m -O0
163 GhcStage1HcOpts    = -O
164 GhcStage2HcOpts    = -O0
165 GhcLibHcOpts       = -O
166 BUILD_PROF_LIBS    = NO
167 SplitObjs          = NO
168 HADDOCK_DOCS       = NO
169 BUILD_DOCBOOK_HTML = NO
170 BUILD_DOCBOOK_PS   = NO
171 BUILD_DOCBOOK_PDF  = NO
172
173 endif
174
175 # -------- A Fast build with optimised libs using LLVM ------------------------
176
177 ifeq "$(BuildFlavour)" "quick-llvm"
178
179 SRC_HC_OPTS        = -H64m -O0 -fllvm
180 GhcStage1HcOpts    = -O -fllvm
181 GhcStage2HcOpts    = -O0 -fllvm
182 GhcLibHcOpts       = -O -fllvm
183 BUILD_PROF_LIBS    = NO
184 SplitObjs          = NO
185 HADDOCK_DOCS       = NO
186 BUILD_DOCBOOK_HTML = NO
187 BUILD_DOCBOOK_PS   = NO
188 BUILD_DOCBOOK_PDF  = NO
189
190 endif
191
192 # -------- A Fast build configured for cross-compilation ----------------------
193
194 ifeq "$(BuildFlavour)" "quick-cross"
195
196 SRC_HC_OPTS        = -H64m -O0
197 GhcStage1HcOpts    = -O
198 GhcStage2HcOpts    = -O0 -fllvm
199 GhcLibHcOpts       = -O -fllvm
200 BUILD_PROF_LIBS    = NO
201 SplitObjs          = NO
202 HADDOCK_DOCS       = NO
203 BUILD_DOCBOOK_HTML = NO
204 BUILD_DOCBOOK_PS   = NO
205 BUILD_DOCBOOK_PDF  = NO
206
207 INTEGER_LIBRARY      = integer-simple
208 Stage1Only           = YES
209 DYNAMIC_BY_DEFAULT   = NO
210 DYNAMIC_GHC_PROGRAMS = NO
211
212 endif
213
214 # -------- Profile the stage2 compiler ----------------------------------------
215
216 ifeq "$(BuildFlavour)" "prof"
217
218 SRC_HC_OPTS        = -H64m -O0
219 GhcStage1HcOpts    = -O
220 GhcStage2HcOpts    = -O
221 GhcLibHcOpts       = -O
222 BUILD_PROF_LIBS    = YES
223 SplitObjs          = NO
224 HADDOCK_DOCS       = NO
225 BUILD_DOCBOOK_HTML = NO
226 BUILD_DOCBOOK_PS   = NO
227 BUILD_DOCBOOK_PDF  = NO
228
229 GhcProfiled        = YES
230
231 endif
232
233 # -------- A Development build (stage 1) --------------------------------------
234
235 ifeq "$(BuildFlavour)" "devel1"
236
237 SRC_HC_OPTS        = -H64m -O
238 GhcStage1HcOpts    = -O0 -DDEBUG
239 GhcStage2HcOpts    = -O
240 GhcLibHcOpts       = -O -dcore-lint
241 BUILD_PROF_LIBS    = NO
242 SplitObjs          = NO
243 HADDOCK_DOCS       = NO
244 BUILD_DOCBOOK_HTML = NO
245 BUILD_DOCBOOK_PS   = NO
246 BUILD_DOCBOOK_PDF  = NO
247
248 LAX_DEPENDENCIES   = YES
249
250 endif
251
252 # -------- A Development build (stage 2) --------------------------------------
253
254 ifeq "$(BuildFlavour)" "devel2"
255
256 SRC_HC_OPTS        = -H64m -O
257 GhcStage1HcOpts    = -O
258 GhcStage2HcOpts    = -O0 -DDEBUG
259 GhcLibHcOpts       = -O -dcore-lint
260 BUILD_PROF_LIBS    = NO
261 SplitObjs          = NO
262 HADDOCK_DOCS       = NO
263 BUILD_DOCBOOK_HTML = NO
264 BUILD_DOCBOOK_PS   = NO
265 BUILD_DOCBOOK_PDF  = NO
266
267 LAX_DEPENDENCIES   = YES
268
269 endif
270
271 # -------- A bench build with optimised libs -----------------------------------
272
273 ifeq "$(BuildFlavour)" "bench"
274
275 SRC_HC_OPTS        = -O -H64m
276 GhcStage1HcOpts    = -O
277 GhcStage2HcOpts    = -O0
278 GhcLibHcOpts       = -O2
279 BUILD_PROF_LIBS    = NO
280 SplitObjs          = NO
281 HADDOCK_DOCS       = NO
282 BUILD_DOCBOOK_HTML = NO
283 BUILD_DOCBOOK_PS   = NO
284 BUILD_DOCBOOK_PDF  = NO
285
286 endif
287
288 # ---------------- Bench build using LLVM --------------------------------------
289
290 ifeq "$(BuildFlavour)" "bench-llvm"
291
292 SRC_HC_OPTS        = -O -H64m
293 GhcStage1HcOpts    = -O -fllvm
294 GhcStage2HcOpts    = -O0 -fllvm
295 GhcLibHcOpts       = -O2 -fllvm
296 BUILD_PROF_LIBS    = NO
297 SplitObjs          = NO
298 HADDOCK_DOCS       = NO
299 BUILD_DOCBOOK_HTML = NO
300 BUILD_DOCBOOK_PS   = NO
301 BUILD_DOCBOOK_PDF  = NO
302
303 endif
304
305 # ------- A Bench build configured for cross-compilation ----------------------
306
307 ifeq "$(BuildFlavour)" "bench-cross"
308
309 SRC_HC_OPTS        = -O -H64m
310 GhcStage1HcOpts    = -O
311 GhcStage2HcOpts    = -O0
312 GhcLibHcOpts       = -O2
313 BUILD_PROF_LIBS    = NO
314 SplitObjs          = NO
315 HADDOCK_DOCS       = NO
316 BUILD_DOCBOOK_HTML = NO
317 BUILD_DOCBOOK_PS   = NO
318 BUILD_DOCBOOK_PDF  = NO
319
320 INTEGER_LIBRARY      = integer-simple
321 Stage1Only           = YES
322 DYNAMIC_BY_DEFAULT   = NO
323 DYNAMIC_GHC_PROGRAMS = NO
324
325 endif
326
327 # -----------------------------------------------------------------------------
328 # Other settings that might be useful
329
330 # NoFib settings
331 NoFibWays =
332 STRIP_CMD = :
333