Merge branch 'master' of http://darcs.haskell.org/ghc
[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 # Uncomment one of these to select a build profile below:
9
10 # Full build with max optimisation and everything enabled (very slow build)
11 #BuildFlavour = perf
12
13 # As above but build GHC using the LLVM backend
14 #BuildFlavour = perf-llvm
15
16 # Fast build with optimised libraries, no profiling (RECOMMENDED):
17 #BuildFlavour = quick
18
19 # Even faster build.  NOT RECOMMENDED: the libraries will be
20 # completely unoptimised, so any code built with this compiler
21 # (including stage2) will run very slowly:
22 #BuildFlavour = quickest
23
24 # Profile the stage2 compiler:
25 #BuildFlavour = prof
26
27 # A development build, working on the stage 1 compiler:
28 #BuildFlavour = devel1
29
30 # A development build, working on the stage 2 compiler:
31 #BuildFlavour = devel2
32
33 GhcLibWays = v
34 DYNAMIC_BY_DEFAULT = NO
35
36 # Uncomment this to get prettier build output.
37 # Please use V = 1 when reporting GHC bugs.
38 # V = 0
39
40 # -------- 1. A Performance/Distribution build--------------------------------
41
42 ifeq "$(BuildFlavour)" "perf"
43
44 # perf matches the default settings, repeated here for comparison:
45
46 SRC_HC_OPTS     = -O -H64m
47 GhcStage1HcOpts = -O -fasm
48 GhcStage2HcOpts = -O2 -fasm
49 GhcHcOpts       = -Rghc-timing
50 GhcLibHcOpts    = -O2
51 GhcLibWays     += p
52
53 ifeq "$(PlatformSupportsSharedLibs)" "YES"
54 GhcLibWays += dyn
55 endif
56
57 endif
58
59 # ---------------- Perf build using LLVM -------------------------------------
60
61 ifeq "$(BuildFlavour)" "perf-llvm"
62
63 SRC_HC_OPTS     = -O -H64m -fllvm
64 GhcStage1HcOpts = -O -fllvm
65 GhcStage2HcOpts = -O2 -fllvm
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 # -------- A Fast build ------------------------------------------------------
77
78 ifeq "$(BuildFlavour)" "quickest"
79
80 SRC_HC_OPTS        = -H64m -O0 -fasm
81 GhcStage1HcOpts    = -O -fasm
82 GhcStage2HcOpts    = -O0 -fasm
83 GhcLibHcOpts       = -O0 -fasm
84 SplitObjs          = NO
85 HADDOCK_DOCS       = NO
86 BUILD_DOCBOOK_HTML = NO
87 BUILD_DOCBOOK_PS   = NO
88 BUILD_DOCBOOK_PDF  = NO
89
90 endif
91
92 # -------- A Fast build with optimised libs ----------------------------------
93
94 ifeq "$(BuildFlavour)" "quick"
95
96 SRC_HC_OPTS        = -H64m -O0 -fasm
97 GhcStage1HcOpts    = -O -fasm
98 GhcStage2HcOpts    = -O0 -fasm
99 GhcLibHcOpts       = -O -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 # -------- Profile the stage2 compiler ---------------------------------------
109
110 ifeq "$(BuildFlavour)" "prof"
111
112 SRC_HC_OPTS        = -H64m -O0 -fasm
113 GhcStage1HcOpts    = -O -fasm
114 GhcStage2HcOpts    = -O -fasm
115 GhcLibHcOpts       = -O -fasm
116
117 GhcLibWays         += p
118 GhcProfiled        = YES
119
120 SplitObjs          = NO
121 HADDOCK_DOCS       = NO
122 BUILD_DOCBOOK_HTML = NO
123 BUILD_DOCBOOK_PS   = NO
124 BUILD_DOCBOOK_PDF  = NO
125
126 endif
127
128
129 # -------- A Development build (stage 1) -------------------------------------
130
131 ifeq "$(BuildFlavour)" "devel1"
132
133 SRC_HC_OPTS        = -H64m -O -fasm
134 GhcLibHcOpts       = -O -dcore-lint
135 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
136 GhcStage2HcOpts    = -Rghc-timing -O -fasm
137 SplitObjs          = NO
138 HADDOCK_DOCS       = NO
139 BUILD_DOCBOOK_HTML = NO
140 BUILD_DOCBOOK_PS   = NO
141 BUILD_DOCBOOK_PDF  = NO
142 LAX_DEPENDENCIES   = YES
143
144 endif
145
146 # -------- A Development build (stage 2) -------------------------------------
147
148 ifeq "$(BuildFlavour)" "devel2"
149
150 SRC_HC_OPTS        = -H64m -O -fasm
151 GhcLibHcOpts       = -O -dcore-lint
152 GhcStage1HcOpts    = -Rghc-timing -O -fasm
153 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
154 SplitObjs          = NO
155 HADDOCK_DOCS       = NO
156 BUILD_DOCBOOK_HTML = NO
157 BUILD_DOCBOOK_PS   = NO
158 BUILD_DOCBOOK_PDF  = NO
159 LAX_DEPENDENCIES   = YES
160
161 # After stage 1 and the libraries have been built, you can uncomment this line:
162
163 # stage=2
164
165 # Then stage 1 will not be touched by the build system, until
166 # you comment the line again.  This is a useful trick for when you're
167 # working on stage 2 and want to freeze stage 1 and the libraries for
168 # a while.
169
170 endif
171
172 # -----------------------------------------------------------------------------
173 # Other settings that might be useful
174
175 # NoFib settings
176 NoFibWays =
177 STRIP_CMD = :
178