Do not build dynamic libraries with the perf-llvm BuildFlavour.
[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 DYNAMIC_BY_DEFAULT   = NO
85 DYNAMIC_GHC_PROGRAMS = NO
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 DYNAMIC_BY_DEFAULT   = NO
136 DYNAMIC_GHC_PROGRAMS = NO
137
138 endif
139
140 # -------- Profile the stage2 compiler ----------------------------------------
141
142 ifeq "$(BuildFlavour)" "prof"
143
144 SRC_HC_OPTS        = -H64m -O0 -fasm
145 GhcStage1HcOpts    = -O -fasm
146 GhcStage2HcOpts    = -O -fasm
147 GhcLibHcOpts       = -O -fasm
148
149 GhcLibWays         += p
150 GhcProfiled        = YES
151
152 SplitObjs          = NO
153 HADDOCK_DOCS       = NO
154 BUILD_DOCBOOK_HTML = NO
155 BUILD_DOCBOOK_PS   = NO
156 BUILD_DOCBOOK_PDF  = NO
157
158 endif
159
160 # -------- A Development build (stage 1) --------------------------------------
161
162 ifeq "$(BuildFlavour)" "devel1"
163
164 SRC_HC_OPTS        = -H64m -O -fasm
165 GhcLibHcOpts       = -O -dcore-lint
166 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
167 GhcStage2HcOpts    = -Rghc-timing -O -fasm
168 SplitObjs          = NO
169 HADDOCK_DOCS       = NO
170 BUILD_DOCBOOK_HTML = NO
171 BUILD_DOCBOOK_PS   = NO
172 BUILD_DOCBOOK_PDF  = NO
173 LAX_DEPENDENCIES   = YES
174
175 endif
176
177 # -------- A Development build (stage 2) --------------------------------------
178
179 ifeq "$(BuildFlavour)" "devel2"
180
181 SRC_HC_OPTS        = -H64m -O -fasm
182 GhcLibHcOpts       = -O -dcore-lint
183 GhcStage1HcOpts    = -Rghc-timing -O -fasm
184 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
185 SplitObjs          = NO
186 HADDOCK_DOCS       = NO
187 BUILD_DOCBOOK_HTML = NO
188 BUILD_DOCBOOK_PS   = NO
189 BUILD_DOCBOOK_PDF  = NO
190 LAX_DEPENDENCIES   = YES
191
192 endif
193
194 # -----------------------------------------------------------------------------
195 # Other settings that might be useful
196
197 # NoFib settings
198 NoFibWays =
199 STRIP_CMD = :
200