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