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