build.mk.sample: Don't disable dynamic linking for LLVM flavours
[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 endif
88
89 # -------- A Fast build -------------------------------------------------------
90
91 ifeq "$(BuildFlavour)" "quickest"
92
93 SRC_HC_OPTS        = -H64m -O0 -fasm
94 GhcStage1HcOpts    = -O -fasm
95 GhcStage2HcOpts    = -O0 -fasm
96 GhcLibHcOpts       = -O0 -fasm
97 SplitObjs          = NO
98 HADDOCK_DOCS       = NO
99 BUILD_DOCBOOK_HTML = NO
100 BUILD_DOCBOOK_PS   = NO
101 BUILD_DOCBOOK_PDF  = NO
102
103 endif
104
105 # -------- A Fast build with optimised libs -----------------------------------
106
107 ifeq "$(BuildFlavour)" "quick"
108
109 SRC_HC_OPTS        = -H64m -O0 -fasm
110 GhcStage1HcOpts    = -O -fasm
111 GhcStage2HcOpts    = -O0 -fasm
112 GhcLibHcOpts       = -O -fasm
113 SplitObjs          = NO
114 HADDOCK_DOCS       = NO
115 BUILD_DOCBOOK_HTML = NO
116 BUILD_DOCBOOK_PS   = NO
117 BUILD_DOCBOOK_PDF  = NO
118
119 endif
120
121 # -------- A Fast build with optimised libs using LLVM ------------------------
122
123 ifeq "$(BuildFlavour)" "quick-llvm"
124
125 SRC_HC_OPTS        = -H64m -O0 -fllvm
126 GhcStage1HcOpts    = -O -fllvm
127 GhcStage2HcOpts    = -O0 -fllvm
128 GhcLibHcOpts       = -O -fllvm
129 SplitObjs          = NO
130 HADDOCK_DOCS       = NO
131 BUILD_DOCBOOK_HTML = NO
132 BUILD_DOCBOOK_PS   = NO
133 BUILD_DOCBOOK_PDF  = NO
134
135 endif
136
137 # -------- A Fast build configured for cross-compilation ----------------------
138
139 ifeq "$(BuildFlavour)" "quick-cross"
140
141 SRC_HC_OPTS        = -H64m -O0
142 GhcStage1HcOpts    = -O -fllvm
143 GhcStage2HcOpts    = -O0 -fllvm
144 GhcLibHcOpts       = -O -fllvm
145 SplitObjs          = NO
146 HADDOCK_DOCS       = NO
147 BUILD_DOCBOOK_HTML = NO
148 BUILD_DOCBOOK_PS   = NO
149 BUILD_DOCBOOK_PDF  = NO
150 INTEGER_LIBRARY    = integer-simple
151 Stage1Only         = YES
152
153 DYNAMIC_BY_DEFAULT   = NO
154 DYNAMIC_GHC_PROGRAMS = NO
155
156 endif
157
158 # -------- Profile the stage2 compiler ----------------------------------------
159
160 ifeq "$(BuildFlavour)" "prof"
161
162 SRC_HC_OPTS        = -H64m -O0 -fasm
163 GhcStage1HcOpts    = -O -fasm
164 GhcStage2HcOpts    = -O -fasm
165 GhcLibHcOpts       = -O -fasm
166
167 GhcLibWays         += p
168 GhcProfiled        = YES
169
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 Development build (stage 1) --------------------------------------
179
180 ifeq "$(BuildFlavour)" "devel1"
181
182 SRC_HC_OPTS        = -H64m -O -fasm
183 GhcLibHcOpts       = -O -dcore-lint
184 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
185 GhcStage2HcOpts    = -Rghc-timing -O -fasm
186 SplitObjs          = NO
187 HADDOCK_DOCS       = NO
188 BUILD_DOCBOOK_HTML = NO
189 BUILD_DOCBOOK_PS   = NO
190 BUILD_DOCBOOK_PDF  = NO
191 LAX_DEPENDENCIES   = YES
192
193 endif
194
195 # -------- A Development build (stage 2) --------------------------------------
196
197 ifeq "$(BuildFlavour)" "devel2"
198
199 SRC_HC_OPTS        = -H64m -O -fasm
200 GhcLibHcOpts       = -O -dcore-lint
201 GhcStage1HcOpts    = -Rghc-timing -O -fasm
202 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
203 SplitObjs          = NO
204 HADDOCK_DOCS       = NO
205 BUILD_DOCBOOK_HTML = NO
206 BUILD_DOCBOOK_PS   = NO
207 BUILD_DOCBOOK_PDF  = NO
208 LAX_DEPENDENCIES   = YES
209
210 endif
211
212 # -----------------------------------------------------------------------------
213 # Other settings that might be useful
214
215 # NoFib settings
216 NoFibWays =
217 STRIP_CMD = :
218