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