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 # Fast build with optimised libraries, no profiling (RECOMMENDED):
14 #BuildFlavour = quick
15
16 # Even faster build.  NOT RECOMMENDED: the libraries will be
17 # completely unoptimised, so any code built with this compiler
18 # (including stage2) will run very slowly:
19 #BuildFlavour = quickest
20
21 # Profile the stage2 compiler:
22 #BuildFlavour = prof
23
24 # A development build, working on the stage 1 compiler:
25 #BuildFlavour = devel1
26
27 # A development build, working on the stage 2 compiler:
28 #BuildFlavour = devel2
29
30 # An unregisterised, optimised build of ghc, for porting:
31 #BuildFlavour = unreg
32
33 GhcLibWays = v
34
35 # -------- 1. A Performance/Distribution build--------------------------------
36
37 ifeq "$(BuildFlavour)" "perf"
38
39 # perf matches the default settings, repeated here for comparison:
40
41 SRC_HC_OPTS     = -O -H64m
42 GhcStage1HcOpts = -O -fasm
43 GhcStage2HcOpts = -O2 -fasm
44 GhcHcOpts       = -Rghc-timing
45 GhcLibHcOpts    = -O2
46 GhcLibWays     += p
47
48 ifeq "$(PlatformSupportsSharedLibs)" "YES"
49 GhcLibWays += dyn
50 endif
51
52 endif
53
54 # -------- A Fast build ------------------------------------------------------
55
56 ifeq "$(BuildFlavour)" "quickest"
57
58 SRC_HC_OPTS        = -H64m -O0 -fasm
59 GhcStage1HcOpts    = -O -fasm
60 GhcStage2HcOpts    = -O0 -fasm
61 GhcLibHcOpts       = -O0 -fasm
62 SplitObjs          = NO
63 HADDOCK_DOCS       = NO
64 BUILD_DOCBOOK_HTML = NO
65 BUILD_DOCBOOK_PS   = NO
66 BUILD_DOCBOOK_PDF  = NO
67
68 endif
69
70 # -------- A Fast build with optimised libs ----------------------------------
71
72 ifeq "$(BuildFlavour)" "quick"
73
74 SRC_HC_OPTS        = -H64m -O0 -fasm
75 GhcStage1HcOpts    = -O -fasm
76 GhcStage2HcOpts    = -O0 -fasm
77 GhcLibHcOpts       = -O -fasm
78 SplitObjs          = NO
79 HADDOCK_DOCS       = NO
80 BUILD_DOCBOOK_HTML = NO
81 BUILD_DOCBOOK_PS   = NO
82 BUILD_DOCBOOK_PDF  = NO
83
84 endif
85
86 # -------- Profile the stage2 compiler ---------------------------------------
87
88 ifeq "$(BuildFlavour)" "prof"
89
90 SRC_HC_OPTS        = -H64m -O0 -fasm
91 GhcStage1HcOpts    = -O -fasm
92 GhcStage2HcOpts    = -O -fasm
93 GhcLibHcOpts       = -O -fasm
94
95 GhcLibWays         += p
96 GhcProfiled        = YES
97
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
107 # -------- A Development build (stage 1) -------------------------------------
108
109 ifeq "$(BuildFlavour)" "devel1"
110
111 SRC_HC_OPTS        = -H64m -O -fasm
112 GhcLibHcOpts       = -O -dcore-lint
113 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
114 GhcStage2HcOpts    = -Rghc-timing -O -fasm
115 SplitObjs          = NO
116 HADDOCK_DOCS       = NO
117 BUILD_DOCBOOK_HTML = NO
118 BUILD_DOCBOOK_PS   = NO
119 BUILD_DOCBOOK_PDF  = NO
120
121 endif
122
123 # -------- A Development build (stage 2) -------------------------------------
124
125 ifeq "$(BuildFlavour)" "devel2"
126
127 SRC_HC_OPTS        = -H64m -O -fasm
128 GhcLibHcOpts       = -O -dcore-lint
129 GhcStage1HcOpts    = -Rghc-timing -O -fasm
130 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
131 SplitObjs          = NO
132 HADDOCK_DOCS       = NO
133 BUILD_DOCBOOK_HTML = NO
134 BUILD_DOCBOOK_PS   = NO
135 BUILD_DOCBOOK_PDF  = NO
136
137 endif
138
139 # -------- A Unregisterised build) -------------------------------------------
140
141 ifeq "$(BuildFlavour)" "unreg"
142
143 GhcUnregisterised    = YES
144 GhcWithNativeCodeGen = NO
145
146 SRC_HC_OPTS          = -O -H64m
147 GhcStage1HcOpts      = -O
148 GhcStage2HcOpts      = -O2
149 GhcHcOpts            = -Rghc-timing
150 GhcLibHcOpts         = -O2
151 SplitObjs            = NO
152 HADDOCK_DOCS         = NO
153 BUILD_DOCBOOK_HTML   = NO
154 BUILD_DOCBOOK_PS     = NO
155 BUILD_DOCBOOK_PDF    = NO
156
157 endif
158
159 # -----------------------------------------------------------------------------
160 # Other settings that might be useful
161
162 # NoFib settings
163 NoFibWays =
164 STRIP_CMD = :