Filter out `-Rghc-timing` for V=0 builds (#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 GhcLibHcOpts    = -O2
91 #SplitObjs
92 #HADDOCK_DOCS
93 #BUILD_DOCBOOK_HTML
94 #BUILD_DOCBOOK_PS
95 #BUILD_DOCBOOK_PDF
96
97 GhcLibWays += p
98 ifeq "$(PlatformSupportsSharedLibs)" "YES"
99 GhcLibWays += dyn
100 endif
101
102 endif
103
104 # ---------------- Perf build using LLVM --------------------------------------
105
106 ifeq "$(BuildFlavour)" "perf-llvm"
107
108 SRC_HC_OPTS     = -O -H64m -fllvm
109 GhcStage1HcOpts = -O -fllvm
110 GhcStage2HcOpts = -O2 -fllvm
111 GhcLibHcOpts    = -O2
112 #SplitObjs
113 #HADDOCK_DOCS
114 #BUILD_DOCBOOK_HTML
115 #BUILD_DOCBOOK_PS
116 #BUILD_DOCBOOK_PDF
117
118 GhcLibWays     += p
119
120 endif
121
122 # ------- A Perf build configured for cross-compilation ----------------------
123
124 ifeq "$(BuildFlavour)" "perf-cross"
125
126 SRC_HC_OPTS        = -O -H64m -fllvm
127 GhcStage1HcOpts    = -O2
128 GhcStage2HcOpts    = -O2 -fllvm
129 GhcLibHcOpts       = -O2
130 #SplitObjs
131 HADDOCK_DOCS       = NO
132 BUILD_DOCBOOK_HTML = NO
133 BUILD_DOCBOOK_PS   = NO
134 BUILD_DOCBOOK_PDF  = NO
135
136 GhcLibWays        += p
137
138 INTEGER_LIBRARY      = integer-simple
139 Stage1Only           = YES
140 DYNAMIC_BY_DEFAULT   = NO
141 DYNAMIC_GHC_PROGRAMS = NO
142
143 endif
144
145 # -------- A Fast build -------------------------------------------------------
146
147 ifeq "$(BuildFlavour)" "quickest"
148
149 SRC_HC_OPTS        = -H64m -O0 $(GhcFAsm)
150 GhcStage1HcOpts    = -O $(GhcFAsm)
151 GhcStage2HcOpts    = -O0 $(GhcFAsm)
152 GhcLibHcOpts       = -O0 $(GhcFAsm)
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 -----------------------------------
162
163 ifeq "$(BuildFlavour)" "quick"
164
165 SRC_HC_OPTS        = -H64m -O0 $(GhcFAsm)
166 GhcStage1HcOpts    = -O $(GhcFAsm)
167 GhcStage2HcOpts    = -O0 $(GhcFAsm)
168 GhcLibHcOpts       = -O $(GhcFAsm)
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 with optimised libs using LLVM ------------------------
178
179 ifeq "$(BuildFlavour)" "quick-llvm"
180
181 SRC_HC_OPTS        = -H64m -O0 -fllvm
182 GhcStage1HcOpts    = -O -fllvm
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
191 endif
192
193 # -------- A Fast build configured for cross-compilation ----------------------
194
195 ifeq "$(BuildFlavour)" "quick-cross"
196
197 SRC_HC_OPTS        = -H64m -O0
198 GhcStage1HcOpts    = -O
199 GhcStage2HcOpts    = -O0 -fllvm
200 GhcLibHcOpts       = -O -fllvm
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 $(GhcFAsm)
219 GhcStage1HcOpts    = -O $(GhcFAsm)
220 GhcStage2HcOpts    = -O $(GhcFAsm)
221 GhcLibHcOpts       = -O $(GhcFAsm)
222 SplitObjs          = NO
223 HADDOCK_DOCS       = NO
224 BUILD_DOCBOOK_HTML = NO
225 BUILD_DOCBOOK_PS   = NO
226 BUILD_DOCBOOK_PDF  = NO
227
228 GhcLibWays        += p
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 $(GhcFAsm)
238 GhcStage1HcOpts    = -O0 -DDEBUG
239 GhcStage2HcOpts    = -O $(GhcFAsm)
240 GhcLibHcOpts       = -O -dcore-lint
241 SplitObjs          = NO
242 HADDOCK_DOCS       = NO
243 BUILD_DOCBOOK_HTML = NO
244 BUILD_DOCBOOK_PS   = NO
245 BUILD_DOCBOOK_PDF  = NO
246
247 LAX_DEPENDENCIES   = YES
248
249 endif
250
251 # -------- A Development build (stage 2) --------------------------------------
252
253 ifeq "$(BuildFlavour)" "devel2"
254
255 SRC_HC_OPTS        = -H64m -O $(GhcFAsm)
256 GhcStage1HcOpts    = -O $(GhcFAsm)
257 GhcStage2HcOpts    = -O0 -DDEBUG
258 GhcLibHcOpts       = -O -dcore-lint
259 SplitObjs          = NO
260 HADDOCK_DOCS       = NO
261 BUILD_DOCBOOK_HTML = NO
262 BUILD_DOCBOOK_PS   = NO
263 BUILD_DOCBOOK_PDF  = NO
264
265 LAX_DEPENDENCIES   = YES
266
267 endif
268
269 # -------- A bench build with optimised libs -----------------------------------
270
271 ifeq "$(BuildFlavour)" "bench"
272
273 SRC_HC_OPTS        = -O -H64m
274 GhcStage1HcOpts    = -O $(GhcFAsm)
275 GhcStage2HcOpts    = -O0 $(GhcFAsm)
276 GhcLibHcOpts       = -O2 $(GhcFAsm)
277 SplitObjs          = NO
278 HADDOCK_DOCS       = NO
279 BUILD_DOCBOOK_HTML = NO
280 BUILD_DOCBOOK_PS   = NO
281 BUILD_DOCBOOK_PDF  = NO
282
283 endif
284
285 # ---------------- Bench build using LLVM --------------------------------------
286
287 ifeq "$(BuildFlavour)" "bench-llvm"
288
289 SRC_HC_OPTS        = -O -H64m
290 GhcStage1HcOpts    = -O -fllvm
291 GhcStage2HcOpts    = -O0 -fllvm
292 GhcLibHcOpts       = -O2 -fllvm
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 $(GhcFAsm)
307 GhcStage2HcOpts    = -O0 $(GhcFAsm)
308 GhcLibHcOpts       = -O2 $(GhcFAsm)
309 SplitObjs          = NO
310 HADDOCK_DOCS       = NO
311 BUILD_DOCBOOK_HTML = NO
312 BUILD_DOCBOOK_PS   = NO
313 BUILD_DOCBOOK_PDF  = NO
314
315 INTEGER_LIBRARY      = integer-simple
316 Stage1Only           = YES
317 DYNAMIC_BY_DEFAULT   = NO
318 DYNAMIC_GHC_PROGRAMS = NO
319
320 endif
321
322 # -----------------------------------------------------------------------------
323 # Other settings that might be useful
324
325 # NoFib settings
326 NoFibWays =
327 STRIP_CMD = :
328