1 # -----------------------------------------------------------------------------
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
8 # -------- Build profiles -----------------------------------------------------
9 # Uncomment one of these to select a build profile below:
11 # Full build with max optimisation and everything enabled (very slow build)
14 # As above but build GHC using the LLVM backend
15 #BuildFlavour = perf-llvm
17 # Fast build with optimised libraries, no profiling (RECOMMENDED):
20 # Fast build with optimised libraries, no profiling, with LLVM:
21 #BuildFlavour = quick-llvm
23 # Fast build configured for a cross compiler
24 #BuildFlavour = quick-cross
26 # Even faster build. NOT RECOMMENDED: the libraries will be
27 # completely unoptimised, so any code built with this compiler
28 # (including stage2) will run very slowly:
29 #BuildFlavour = quickest
31 # Profile the stage2 compiler:
34 # A development build, working on the stage 1 compiler:
35 #BuildFlavour = devel1
37 # A development build, working on the stage 2 compiler:
38 #BuildFlavour = devel2
40 # -------- Miscellaneous variables --------------------------------------------
42 # Set to V = 0 to get prettier build output.
43 # Please use V = 1 when reporting GHC bugs.
46 # After stage 1 and the libraries have been built, you can uncomment this line:
50 # Then stage 1 will not be touched by the build system, until
51 # you comment the line again. This is a useful trick for when you're
52 # working on stage 2 and want to freeze stage 1 and the libraries for
55 GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
57 # ----------- A Performance/Distribution build --------------------------------
59 ifeq "$(BuildFlavour)" "perf"
61 # perf matches the default settings, repeated here for comparison:
63 SRC_HC_OPTS = -O -H64m
64 GhcStage1HcOpts = -O -fasm
65 GhcStage2HcOpts = -O2 -fasm
66 GhcHcOpts = -Rghc-timing
70 ifeq "$(PlatformSupportsSharedLibs)" "YES"
76 # ---------------- Perf build using LLVM --------------------------------------
78 ifeq "$(BuildFlavour)" "perf-llvm"
80 SRC_HC_OPTS = -O -H64m -fllvm
81 GhcStage1HcOpts = -O -fllvm
82 GhcStage2HcOpts = -O2 -fllvm
83 GhcHcOpts = -Rghc-timing
87 DYNAMIC_BY_DEFAULT = NO
88 DYNAMIC_GHC_PROGRAMS = NO
92 # -------- A Fast build -------------------------------------------------------
94 ifeq "$(BuildFlavour)" "quickest"
96 SRC_HC_OPTS = -H64m -O0 -fasm
97 GhcStage1HcOpts = -O -fasm
98 GhcStage2HcOpts = -O0 -fasm
99 GhcLibHcOpts = -O0 -fasm
102 BUILD_DOCBOOK_HTML = NO
103 BUILD_DOCBOOK_PS = NO
104 BUILD_DOCBOOK_PDF = NO
108 # -------- A Fast build with optimised libs -----------------------------------
110 ifeq "$(BuildFlavour)" "quick"
112 SRC_HC_OPTS = -H64m -O0 -fasm
113 GhcStage1HcOpts = -O -fasm
114 GhcStage2HcOpts = -O0 -fasm
115 GhcLibHcOpts = -O -fasm
118 BUILD_DOCBOOK_HTML = NO
119 BUILD_DOCBOOK_PS = NO
120 BUILD_DOCBOOK_PDF = NO
124 # -------- A Fast build with optimised libs using LLVM ------------------------
126 ifeq "$(BuildFlavour)" "quick-llvm"
128 SRC_HC_OPTS = -H64m -O0 -fllvm
129 GhcStage1HcOpts = -O -fllvm
130 GhcStage2HcOpts = -O0 -fllvm
131 GhcLibHcOpts = -O -fllvm
134 BUILD_DOCBOOK_HTML = NO
135 BUILD_DOCBOOK_PS = NO
136 BUILD_DOCBOOK_PDF = NO
138 DYNAMIC_BY_DEFAULT = NO
139 DYNAMIC_GHC_PROGRAMS = NO
143 # -------- A Fast build configured for cross-compilation ----------------------
145 ifeq "$(BuildFlavour)" "quick-cross"
147 SRC_HC_OPTS = -H64m -O0
148 GhcStage1HcOpts = -O -fllvm
149 GhcStage2HcOpts = -O0 -fllvm
150 GhcLibHcOpts = -O -fllvm
153 BUILD_DOCBOOK_HTML = NO
154 BUILD_DOCBOOK_PS = NO
155 BUILD_DOCBOOK_PDF = NO
156 INTEGER_LIBRARY = integer-simple
159 DYNAMIC_BY_DEFAULT = NO
160 DYNAMIC_GHC_PROGRAMS = NO
164 # -------- Profile the stage2 compiler ----------------------------------------
166 ifeq "$(BuildFlavour)" "prof"
168 SRC_HC_OPTS = -H64m -O0 -fasm
169 GhcStage1HcOpts = -O -fasm
170 GhcStage2HcOpts = -O -fasm
171 GhcLibHcOpts = -O -fasm
178 BUILD_DOCBOOK_HTML = NO
179 BUILD_DOCBOOK_PS = NO
180 BUILD_DOCBOOK_PDF = NO
184 # -------- A Development build (stage 1) --------------------------------------
186 ifeq "$(BuildFlavour)" "devel1"
188 SRC_HC_OPTS = -H64m -O -fasm
189 GhcLibHcOpts = -O -dcore-lint
190 GhcStage1HcOpts = -Rghc-timing -O0 -DDEBUG
191 GhcStage2HcOpts = -Rghc-timing -O -fasm
194 BUILD_DOCBOOK_HTML = NO
195 BUILD_DOCBOOK_PS = NO
196 BUILD_DOCBOOK_PDF = NO
197 LAX_DEPENDENCIES = YES
201 # -------- A Development build (stage 2) --------------------------------------
203 ifeq "$(BuildFlavour)" "devel2"
205 SRC_HC_OPTS = -H64m -O -fasm
206 GhcLibHcOpts = -O -dcore-lint
207 GhcStage1HcOpts = -Rghc-timing -O -fasm
208 GhcStage2HcOpts = -Rghc-timing -O0 -DDEBUG
211 BUILD_DOCBOOK_HTML = NO
212 BUILD_DOCBOOK_PS = NO
213 BUILD_DOCBOOK_PDF = NO
214 LAX_DEPENDENCIES = YES
218 # -----------------------------------------------------------------------------
219 # Other settings that might be useful