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