Add a perf-cross build setting.
[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 # -------- Miscellaneous variables --------------------------------------------
44
45 # Set to V = 0 to get prettier build output.
46 # Please use V = 1 when reporting GHC bugs.
47 V = 1
48
49 # After stage 1 and the libraries have been built, you can uncomment this line:
50
51 #stage=2
52
53 # Then stage 1 will not be touched by the build system, until
54 # you comment the line again.  This is a useful trick for when you're
55 # working on stage 2 and want to freeze stage 1 and the libraries for
56 # a while.
57
58 GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
59
60 # ----------- A Performance/Distribution build --------------------------------
61
62 ifeq "$(BuildFlavour)" "perf"
63
64 # perf matches the default settings, repeated here for comparison:
65
66 SRC_HC_OPTS     = -O -H64m
67 GhcStage1HcOpts = -O -fasm
68 GhcStage2HcOpts = -O2 -fasm
69 GhcHcOpts       = -Rghc-timing
70 GhcLibHcOpts    = -O2
71 GhcLibWays     += p
72
73 ifeq "$(PlatformSupportsSharedLibs)" "YES"
74 GhcLibWays += dyn
75 endif
76
77 endif
78
79 # ---------------- Perf build using LLVM --------------------------------------
80
81 ifeq "$(BuildFlavour)" "perf-llvm"
82
83 SRC_HC_OPTS     = -O -H64m -fllvm
84 GhcStage1HcOpts = -O -fllvm
85 GhcStage2HcOpts = -O2 -fllvm
86 GhcHcOpts       = -Rghc-timing
87 GhcLibHcOpts    = -O2
88 GhcLibWays     += p
89
90 endif
91
92 # ------- A Perf build configured for cross-compilation ----------------------
93
94 ifeq "$(BuildFlavour)" "perf-cross"
95
96 SRC_HC_OPTS     = -O -H64m -fllvm
97 GhcStage1HcOpts = -O2 -fllvm
98 GhcStage2HcOpts = -O2 -fllvm
99 GhcHcOpts       = -Rghc-timing
100 GhcLibHcOpts    = -O2
101 GhcLibWays     += p
102 INTEGER_LIBRARY    = integer-simple
103 Stage1Only         = YES
104
105 HADDOCK_DOCS       = NO
106 BUILD_DOCBOOK_HTML = NO
107 BUILD_DOCBOOK_PS   = NO
108 BUILD_DOCBOOK_PDF  = NO
109
110 DYNAMIC_BY_DEFAULT   = NO
111 DYNAMIC_GHC_PROGRAMS = NO
112
113 endif
114
115 # -------- A Fast build -------------------------------------------------------
116
117 ifeq "$(BuildFlavour)" "quickest"
118
119 SRC_HC_OPTS        = -H64m -O0 -fasm
120 GhcStage1HcOpts    = -O -fasm
121 GhcStage2HcOpts    = -O0 -fasm
122 GhcLibHcOpts       = -O0 -fasm
123 SplitObjs          = NO
124 HADDOCK_DOCS       = NO
125 BUILD_DOCBOOK_HTML = NO
126 BUILD_DOCBOOK_PS   = NO
127 BUILD_DOCBOOK_PDF  = NO
128
129 endif
130
131 # -------- A Fast build with optimised libs -----------------------------------
132
133 ifeq "$(BuildFlavour)" "quick"
134
135 SRC_HC_OPTS        = -H64m -O0 -fasm
136 GhcStage1HcOpts    = -O -fasm
137 GhcStage2HcOpts    = -O0 -fasm
138 GhcLibHcOpts       = -O -fasm
139 SplitObjs          = NO
140 HADDOCK_DOCS       = NO
141 BUILD_DOCBOOK_HTML = NO
142 BUILD_DOCBOOK_PS   = NO
143 BUILD_DOCBOOK_PDF  = NO
144
145 endif
146
147 # -------- A Fast build with optimised libs using LLVM ------------------------
148
149 ifeq "$(BuildFlavour)" "quick-llvm"
150
151 SRC_HC_OPTS        = -H64m -O0 -fllvm
152 GhcStage1HcOpts    = -O -fllvm
153 GhcStage2HcOpts    = -O0 -fllvm
154 GhcLibHcOpts       = -O -fllvm
155 SplitObjs          = NO
156 HADDOCK_DOCS       = NO
157 BUILD_DOCBOOK_HTML = NO
158 BUILD_DOCBOOK_PS   = NO
159 BUILD_DOCBOOK_PDF  = NO
160
161 endif
162
163 # -------- A Fast build configured for cross-compilation ----------------------
164
165 ifeq "$(BuildFlavour)" "quick-cross"
166
167 SRC_HC_OPTS        = -H64m -O0
168 GhcStage1HcOpts    = -O -fllvm
169 GhcStage2HcOpts    = -O0 -fllvm
170 GhcLibHcOpts       = -O -fllvm
171 SplitObjs          = NO
172 HADDOCK_DOCS       = NO
173 BUILD_DOCBOOK_HTML = NO
174 BUILD_DOCBOOK_PS   = NO
175 BUILD_DOCBOOK_PDF  = NO
176 INTEGER_LIBRARY    = integer-simple
177 Stage1Only         = YES
178
179 DYNAMIC_BY_DEFAULT   = NO
180 DYNAMIC_GHC_PROGRAMS = NO
181
182 endif
183
184 # -------- Profile the stage2 compiler ----------------------------------------
185
186 ifeq "$(BuildFlavour)" "prof"
187
188 SRC_HC_OPTS        = -H64m -O0 -fasm
189 GhcStage1HcOpts    = -O -fasm
190 GhcStage2HcOpts    = -O -fasm
191 GhcLibHcOpts       = -O -fasm
192
193 GhcLibWays         += p
194 GhcProfiled        = YES
195
196 SplitObjs          = NO
197 HADDOCK_DOCS       = NO
198 BUILD_DOCBOOK_HTML = NO
199 BUILD_DOCBOOK_PS   = NO
200 BUILD_DOCBOOK_PDF  = NO
201
202 endif
203
204 # -------- A Development build (stage 1) --------------------------------------
205
206 ifeq "$(BuildFlavour)" "devel1"
207
208 SRC_HC_OPTS        = -H64m -O -fasm
209 GhcLibHcOpts       = -O -dcore-lint
210 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
211 GhcStage2HcOpts    = -Rghc-timing -O -fasm
212 SplitObjs          = NO
213 HADDOCK_DOCS       = NO
214 BUILD_DOCBOOK_HTML = NO
215 BUILD_DOCBOOK_PS   = NO
216 BUILD_DOCBOOK_PDF  = NO
217 LAX_DEPENDENCIES   = YES
218
219 endif
220
221 # -------- A Development build (stage 2) --------------------------------------
222
223 ifeq "$(BuildFlavour)" "devel2"
224
225 SRC_HC_OPTS        = -H64m -O -fasm
226 GhcLibHcOpts       = -O -dcore-lint
227 GhcStage1HcOpts    = -Rghc-timing -O -fasm
228 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
229 SplitObjs          = NO
230 HADDOCK_DOCS       = NO
231 BUILD_DOCBOOK_HTML = NO
232 BUILD_DOCBOOK_PS   = NO
233 BUILD_DOCBOOK_PDF  = NO
234 LAX_DEPENDENCIES   = YES
235
236 endif
237
238 # -----------------------------------------------------------------------------
239 # Other settings that might be useful
240
241 # NoFib settings
242 NoFibWays =
243 STRIP_CMD = :
244