Reorganize mk/build.mk.sample a little.
[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 endif
89
90 # -------- A Fast build -------------------------------------------------------
91
92 ifeq "$(BuildFlavour)" "quickest"
93
94 SRC_HC_OPTS        = -H64m -O0 -fasm
95 GhcStage1HcOpts    = -O -fasm
96 GhcStage2HcOpts    = -O0 -fasm
97 GhcLibHcOpts       = -O0 -fasm
98 SplitObjs          = NO
99 HADDOCK_DOCS       = NO
100 BUILD_DOCBOOK_HTML = NO
101 BUILD_DOCBOOK_PS   = NO
102 BUILD_DOCBOOK_PDF  = NO
103
104 endif
105
106 # -------- A Fast build with optimised libs -----------------------------------
107
108 ifeq "$(BuildFlavour)" "quick"
109
110 SRC_HC_OPTS        = -H64m -O0 -fasm
111 GhcStage1HcOpts    = -O -fasm
112 GhcStage2HcOpts    = -O0 -fasm
113 GhcLibHcOpts       = -O -fasm
114 SplitObjs          = NO
115 HADDOCK_DOCS       = NO
116 BUILD_DOCBOOK_HTML = NO
117 BUILD_DOCBOOK_PS   = NO
118 BUILD_DOCBOOK_PDF  = NO
119
120 endif
121
122 # -------- A Fast build with optimised libs using LLVM ------------------------
123
124 ifeq "$(BuildFlavour)" "quick-llvm"
125
126 SRC_HC_OPTS        = -H64m -O0 -fllvm
127 GhcStage1HcOpts    = -O -fllvm
128 GhcStage2HcOpts    = -O0 -fllvm
129 GhcLibHcOpts       = -O -fllvm
130 SplitObjs          = NO
131 HADDOCK_DOCS       = NO
132 BUILD_DOCBOOK_HTML = NO
133 BUILD_DOCBOOK_PS   = NO
134 BUILD_DOCBOOK_PDF  = NO
135
136 endif
137
138 # -------- Profile the stage2 compiler ----------------------------------------
139
140 ifeq "$(BuildFlavour)" "prof"
141
142 SRC_HC_OPTS        = -H64m -O0 -fasm
143 GhcStage1HcOpts    = -O -fasm
144 GhcStage2HcOpts    = -O -fasm
145 GhcLibHcOpts       = -O -fasm
146
147 GhcLibWays         += p
148 GhcProfiled        = YES
149
150 SplitObjs          = NO
151 HADDOCK_DOCS       = NO
152 BUILD_DOCBOOK_HTML = NO
153 BUILD_DOCBOOK_PS   = NO
154 BUILD_DOCBOOK_PDF  = NO
155
156 endif
157
158 # -------- A Development build (stage 1) --------------------------------------
159
160 ifeq "$(BuildFlavour)" "devel1"
161
162 SRC_HC_OPTS        = -H64m -O -fasm
163 GhcLibHcOpts       = -O -dcore-lint
164 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
165 GhcStage2HcOpts    = -Rghc-timing -O -fasm
166 SplitObjs          = NO
167 HADDOCK_DOCS       = NO
168 BUILD_DOCBOOK_HTML = NO
169 BUILD_DOCBOOK_PS   = NO
170 BUILD_DOCBOOK_PDF  = NO
171 LAX_DEPENDENCIES   = YES
172
173 endif
174
175 # -------- A Development build (stage 2) --------------------------------------
176
177 ifeq "$(BuildFlavour)" "devel2"
178
179 SRC_HC_OPTS        = -H64m -O -fasm
180 GhcLibHcOpts       = -O -dcore-lint
181 GhcStage1HcOpts    = -Rghc-timing -O -fasm
182 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
183 SplitObjs          = NO
184 HADDOCK_DOCS       = NO
185 BUILD_DOCBOOK_HTML = NO
186 BUILD_DOCBOOK_PS   = NO
187 BUILD_DOCBOOK_PDF  = NO
188 LAX_DEPENDENCIES   = YES
189
190 endif
191
192 # -----------------------------------------------------------------------------
193 # Other settings that might be useful
194
195 # NoFib settings
196 NoFibWays =
197 STRIP_CMD = :
198