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