Implement PowerPC 64-bit native code backend for Linux
[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 GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
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
89 GhcStage2HcOpts = -O2
90 GhcLibHcOpts    = -O2
91 #SplitObjs
92 #HADDOCK_DOCS
93 #BUILD_DOCBOOK_HTML
94 #BUILD_DOCBOOK_PS
95 #BUILD_DOCBOOK_PDF
96
97 GhcLibWays  = v
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 GhcLibHcOpts    = -O2
113 #SplitObjs
114 #HADDOCK_DOCS
115 #BUILD_DOCBOOK_HTML
116 #BUILD_DOCBOOK_PS
117 #BUILD_DOCBOOK_PDF
118
119 GhcLibWays     += p
120
121 endif
122
123 # ------- A Perf build configured for cross-compilation ----------------------
124
125 ifeq "$(BuildFlavour)" "perf-cross"
126
127 SRC_HC_OPTS        = -O -H64m -fllvm
128 GhcStage1HcOpts    = -O2
129 GhcStage2HcOpts    = -O2 -fllvm
130 GhcLibHcOpts       = -O2
131 #SplitObjs
132 HADDOCK_DOCS       = NO
133 BUILD_DOCBOOK_HTML = NO
134 BUILD_DOCBOOK_PS   = NO
135 BUILD_DOCBOOK_PDF  = NO
136
137 GhcLibWays        += p
138
139 INTEGER_LIBRARY      = integer-simple
140 Stage1Only           = YES
141 DYNAMIC_BY_DEFAULT   = NO
142 DYNAMIC_GHC_PROGRAMS = NO
143
144 endif
145
146 # -------- A Fast build -------------------------------------------------------
147
148 ifeq "$(BuildFlavour)" "quickest"
149
150 SRC_HC_OPTS        = -H64m -O0
151 GhcStage1HcOpts    = -O
152 GhcStage2HcOpts    = -O0
153 GhcLibHcOpts       = -O0
154 SplitObjs          = NO
155 HADDOCK_DOCS       = NO
156 BUILD_DOCBOOK_HTML = NO
157 BUILD_DOCBOOK_PS   = NO
158 BUILD_DOCBOOK_PDF  = NO
159
160 endif
161
162 # -------- A Fast build with optimised libs -----------------------------------
163
164 ifeq "$(BuildFlavour)" "quick"
165
166 SRC_HC_OPTS        = -H64m -O0
167 GhcStage1HcOpts    = -O
168 GhcStage2HcOpts    = -O0
169 GhcLibHcOpts       = -O
170 SplitObjs          = NO
171 HADDOCK_DOCS       = NO
172 BUILD_DOCBOOK_HTML = NO
173 BUILD_DOCBOOK_PS   = NO
174 BUILD_DOCBOOK_PDF  = NO
175
176 endif
177
178 # -------- A Fast build with optimised libs using LLVM ------------------------
179
180 ifeq "$(BuildFlavour)" "quick-llvm"
181
182 SRC_HC_OPTS        = -H64m -O0 -fllvm
183 GhcStage1HcOpts    = -O -fllvm
184 GhcStage2HcOpts    = -O0 -fllvm
185 GhcLibHcOpts       = -O -fllvm
186 SplitObjs          = NO
187 HADDOCK_DOCS       = NO
188 BUILD_DOCBOOK_HTML = NO
189 BUILD_DOCBOOK_PS   = NO
190 BUILD_DOCBOOK_PDF  = NO
191
192 endif
193
194 # -------- A Fast build configured for cross-compilation ----------------------
195
196 ifeq "$(BuildFlavour)" "quick-cross"
197
198 SRC_HC_OPTS        = -H64m -O0
199 GhcStage1HcOpts    = -O
200 GhcStage2HcOpts    = -O0 -fllvm
201 GhcLibHcOpts       = -O -fllvm
202 SplitObjs          = NO
203 HADDOCK_DOCS       = NO
204 BUILD_DOCBOOK_HTML = NO
205 BUILD_DOCBOOK_PS   = NO
206 BUILD_DOCBOOK_PDF  = NO
207
208 INTEGER_LIBRARY      = integer-simple
209 Stage1Only           = YES
210 DYNAMIC_BY_DEFAULT   = NO
211 DYNAMIC_GHC_PROGRAMS = NO
212
213 endif
214
215 # -------- Profile the stage2 compiler ----------------------------------------
216
217 ifeq "$(BuildFlavour)" "prof"
218
219 SRC_HC_OPTS        = -H64m -O0
220 GhcStage1HcOpts    = -O
221 GhcStage2HcOpts    = -O
222 GhcLibHcOpts       = -O
223 SplitObjs          = NO
224 HADDOCK_DOCS       = NO
225 BUILD_DOCBOOK_HTML = NO
226 BUILD_DOCBOOK_PS   = NO
227 BUILD_DOCBOOK_PDF  = NO
228
229 GhcLibWays        += p
230 GhcProfiled        = YES
231
232 endif
233
234 # -------- A Development build (stage 1) --------------------------------------
235
236 ifeq "$(BuildFlavour)" "devel1"
237
238 SRC_HC_OPTS        = -H64m -O
239 GhcStage1HcOpts    = -O0 -DDEBUG
240 GhcStage2HcOpts    = -O
241 GhcLibHcOpts       = -O -dcore-lint
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 SplitObjs          = NO
261 HADDOCK_DOCS       = NO
262 BUILD_DOCBOOK_HTML = NO
263 BUILD_DOCBOOK_PS   = NO
264 BUILD_DOCBOOK_PDF  = NO
265
266 LAX_DEPENDENCIES   = YES
267
268 endif
269
270 # -------- A bench build with optimised libs -----------------------------------
271
272 ifeq "$(BuildFlavour)" "bench"
273
274 SRC_HC_OPTS        = -O -H64m
275 GhcStage1HcOpts    = -O
276 GhcStage2HcOpts    = -O0
277 GhcLibHcOpts       = -O2
278 SplitObjs          = NO
279 HADDOCK_DOCS       = NO
280 BUILD_DOCBOOK_HTML = NO
281 BUILD_DOCBOOK_PS   = NO
282 BUILD_DOCBOOK_PDF  = NO
283
284 endif
285
286 # ---------------- Bench build using LLVM --------------------------------------
287
288 ifeq "$(BuildFlavour)" "bench-llvm"
289
290 SRC_HC_OPTS        = -O -H64m
291 GhcStage1HcOpts    = -O -fllvm
292 GhcStage2HcOpts    = -O0 -fllvm
293 GhcLibHcOpts       = -O2 -fllvm
294 SplitObjs          = NO
295 HADDOCK_DOCS       = NO
296 BUILD_DOCBOOK_HTML = NO
297 BUILD_DOCBOOK_PS   = NO
298 BUILD_DOCBOOK_PDF  = NO
299
300 endif
301
302 # ------- A Bench build configured for cross-compilation ----------------------
303
304 ifeq "$(BuildFlavour)" "bench-cross"
305
306 SRC_HC_OPTS        = -O -H64m
307 GhcStage1HcOpts    = -O
308 GhcStage2HcOpts    = -O0
309 GhcLibHcOpts       = -O2
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