Fold base.git into ghc.git (re #8545)
[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 GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
70
71 # ----------- A Performance/Distribution build --------------------------------
72
73 ifeq "$(BuildFlavour)" "perf"
74
75 # perf matches the default settings, repeated here for comparison:
76
77 SRC_HC_OPTS     = -O -H64m
78 GhcStage1HcOpts = -O -fasm
79 GhcStage2HcOpts = -O2 -fasm
80 GhcHcOpts       = -Rghc-timing
81 GhcLibHcOpts    = -O2
82 GhcLibWays     += p
83
84 ifeq "$(PlatformSupportsSharedLibs)" "YES"
85 GhcLibWays += dyn
86 endif
87
88 endif
89
90 # ---------------- Perf build using LLVM --------------------------------------
91
92 ifeq "$(BuildFlavour)" "perf-llvm"
93
94 SRC_HC_OPTS     = -O -H64m -fllvm
95 GhcStage1HcOpts = -O -fllvm
96 GhcStage2HcOpts = -O2 -fllvm
97 GhcHcOpts       = -Rghc-timing
98 GhcLibHcOpts    = -O2
99 GhcLibWays     += p
100
101 endif
102
103 # ------- A Perf build configured for cross-compilation ----------------------
104
105 ifeq "$(BuildFlavour)" "perf-cross"
106
107 SRC_HC_OPTS     = -O -H64m -fllvm
108 GhcStage1HcOpts = -O2 -fllvm
109 GhcStage2HcOpts = -O2 -fllvm
110 GhcHcOpts       = -Rghc-timing
111 GhcLibHcOpts    = -O2
112 GhcLibWays     += p
113 INTEGER_LIBRARY    = integer-simple
114 Stage1Only         = YES
115
116 HADDOCK_DOCS       = NO
117 BUILD_DOCBOOK_HTML = NO
118 BUILD_DOCBOOK_PS   = NO
119 BUILD_DOCBOOK_PDF  = NO
120
121 DYNAMIC_BY_DEFAULT   = NO
122 DYNAMIC_GHC_PROGRAMS = NO
123
124 endif
125
126 # -------- A Fast build -------------------------------------------------------
127
128 ifeq "$(BuildFlavour)" "quickest"
129
130 SRC_HC_OPTS        = -H64m -O0 -fasm
131 GhcStage1HcOpts    = -O -fasm
132 GhcStage2HcOpts    = -O0 -fasm
133 GhcLibHcOpts       = -O0 -fasm
134 SplitObjs          = NO
135 HADDOCK_DOCS       = NO
136 BUILD_DOCBOOK_HTML = NO
137 BUILD_DOCBOOK_PS   = NO
138 BUILD_DOCBOOK_PDF  = NO
139
140 endif
141
142 # -------- A Fast build with optimised libs -----------------------------------
143
144 ifeq "$(BuildFlavour)" "quick"
145
146 SRC_HC_OPTS        = -H64m -O0 -fasm
147 GhcStage1HcOpts    = -O -fasm
148 GhcStage2HcOpts    = -O0 -fasm
149 GhcLibHcOpts       = -O -fasm
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 using LLVM ------------------------
159
160 ifeq "$(BuildFlavour)" "quick-llvm"
161
162 SRC_HC_OPTS        = -H64m -O0 -fllvm
163 GhcStage1HcOpts    = -O -fllvm
164 GhcStage2HcOpts    = -O0 -fllvm
165 GhcLibHcOpts       = -O -fllvm
166 SplitObjs          = NO
167 HADDOCK_DOCS       = NO
168 BUILD_DOCBOOK_HTML = NO
169 BUILD_DOCBOOK_PS   = NO
170 BUILD_DOCBOOK_PDF  = NO
171
172 endif
173
174 # -------- A Fast build configured for cross-compilation ----------------------
175
176 ifeq "$(BuildFlavour)" "quick-cross"
177
178 SRC_HC_OPTS        = -H64m -O0
179 GhcStage1HcOpts    = -O -fllvm
180 GhcStage2HcOpts    = -O0 -fllvm
181 GhcLibHcOpts       = -O -fllvm
182 SplitObjs          = NO
183 HADDOCK_DOCS       = NO
184 BUILD_DOCBOOK_HTML = NO
185 BUILD_DOCBOOK_PS   = NO
186 BUILD_DOCBOOK_PDF  = NO
187 INTEGER_LIBRARY    = integer-simple
188 Stage1Only         = YES
189
190 DYNAMIC_BY_DEFAULT   = NO
191 DYNAMIC_GHC_PROGRAMS = NO
192
193 endif
194
195 # -------- Profile the stage2 compiler ----------------------------------------
196
197 ifeq "$(BuildFlavour)" "prof"
198
199 SRC_HC_OPTS        = -H64m -O0 -fasm
200 GhcStage1HcOpts    = -O -fasm
201 GhcStage2HcOpts    = -O -fasm
202 GhcLibHcOpts       = -O -fasm
203
204 GhcLibWays         += p
205 GhcProfiled        = YES
206
207 SplitObjs          = NO
208 HADDOCK_DOCS       = NO
209 BUILD_DOCBOOK_HTML = NO
210 BUILD_DOCBOOK_PS   = NO
211 BUILD_DOCBOOK_PDF  = NO
212
213 endif
214
215 # -------- A Development build (stage 1) --------------------------------------
216
217 ifeq "$(BuildFlavour)" "devel1"
218
219 SRC_HC_OPTS        = -H64m -O -fasm
220 GhcLibHcOpts       = -O -dcore-lint
221 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
222 GhcStage2HcOpts    = -Rghc-timing -O -fasm
223 SplitObjs          = NO
224 HADDOCK_DOCS       = NO
225 BUILD_DOCBOOK_HTML = NO
226 BUILD_DOCBOOK_PS   = NO
227 BUILD_DOCBOOK_PDF  = NO
228 LAX_DEPENDENCIES   = YES
229
230 endif
231
232 # -------- A Development build (stage 2) --------------------------------------
233
234 ifeq "$(BuildFlavour)" "devel2"
235
236 SRC_HC_OPTS        = -H64m -O -fasm
237 GhcLibHcOpts       = -O -dcore-lint
238 GhcStage1HcOpts    = -Rghc-timing -O -fasm
239 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
240 SplitObjs          = NO
241 HADDOCK_DOCS       = NO
242 BUILD_DOCBOOK_HTML = NO
243 BUILD_DOCBOOK_PS   = NO
244 BUILD_DOCBOOK_PDF  = NO
245 LAX_DEPENDENCIES   = YES
246
247 endif
248
249 # -------- A bench build with optimised libs -----------------------------------
250
251 ifeq "$(BuildFlavour)" "bench"
252
253 SRC_HC_OPTS        = -O -H64m
254 GhcStage1HcOpts    = -O -fasm
255 GhcStage2HcOpts    = -O0 -fasm
256 GhcLibHcOpts       = -O2 -fasm
257 SplitObjs          = NO
258 HADDOCK_DOCS       = NO
259 BUILD_DOCBOOK_HTML = NO
260 BUILD_DOCBOOK_PS   = NO
261 BUILD_DOCBOOK_PDF  = NO
262
263 endif
264
265 # ---------------- Bench build using LLVM --------------------------------------
266
267 ifeq "$(BuildFlavour)" "bench-llvm"
268
269 SRC_HC_OPTS        = -O -H64m
270 GhcStage1HcOpts    = -O -fllvm
271 GhcStage2HcOpts    = -O0 -fllvm
272 GhcLibHcOpts       = -O2 -fllvm
273 SplitObjs          = NO
274 HADDOCK_DOCS       = NO
275 BUILD_DOCBOOK_HTML = NO
276 BUILD_DOCBOOK_PS   = NO
277 BUILD_DOCBOOK_PDF  = NO
278
279 endif
280
281 # ------- A Bench build configured for cross-compilation ----------------------
282
283 ifeq "$(BuildFlavour)" "bench-cross"
284
285 SRC_HC_OPTS        = -O -H64m
286 GhcStage1HcOpts    = -O -fasm
287 GhcStage2HcOpts    = -O0 -fasm
288 GhcLibHcOpts       = -O2 -fasm
289 SplitObjs          = NO
290 INTEGER_LIBRARY    = integer-simple
291 Stage1Only         = YES
292 HADDOCK_DOCS       = NO
293 BUILD_DOCBOOK_HTML = NO
294 BUILD_DOCBOOK_PS   = NO
295 BUILD_DOCBOOK_PDF  = NO
296
297 DYNAMIC_BY_DEFAULT   = NO
298 DYNAMIC_GHC_PROGRAMS = NO
299
300 endif
301
302 # -----------------------------------------------------------------------------
303 # Other settings that might be useful
304
305 # NoFib settings
306 NoFibWays =
307 STRIP_CMD = :
308