make GhcProfiled work, and add a "prof" flavour to build.mk
[ghc-hetmet.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 (slow build)
11 #BuildFlavour = perf
12
13 # Fastest build (libs unoptimised):
14 #BuildFlavour = quickest
15
16 # Fast build with optimised libraries:
17 #BuildFlavour = quick
18
19 # Profile the stage2 compiler:
20 #BuildFlavour = prof
21
22 # A development build, working on the stage 1 compiler:
23 #BuildFlavour = devel1
24
25 # A development build, working on the stage 2 compiler:
26 #BuildFlavour = devel2
27
28 GhcLibWays = v
29
30 # -------- 1. A Performance/Distribution build--------------------------------
31
32 ifeq "$(BuildFlavour)" "perf"
33
34 # perf matches the default settings, repeated here for comparison:
35
36 SRC_HC_OPTS     = -O -H64m
37 GhcStage1HcOpts = -O -fasm
38 GhcStage2HcOpts = -O2 -fasm
39 GhcHcOpts       = -Rghc-timing
40 GhcLibHcOpts    = -O2 -XGenerics
41 GhcLibWays     += p
42
43 endif
44
45 # -------- A Fast build ------------------------------------------------------
46
47 ifeq "$(BuildFlavour)" "quickest"
48
49 SRC_HC_OPTS        = -H64m -O0 -fasm
50 GhcStage1HcOpts    = -O -fasm
51 GhcStage2HcOpts    = -O0 -fasm
52 GhcLibHcOpts       = -O0 -fasm
53 SplitObjs          = NO
54 HADDOCK_DOCS       = NO
55 BUILD_DOCBOOK_HTML = NO
56 BUILD_DOCBOOK_PS   = NO
57 BUILD_DOCBOOK_PDF  = NO
58
59 endif
60
61 # -------- A Fast build with optimised libs ----------------------------------
62
63 ifeq "$(BuildFlavour)" "quick"
64
65 SRC_HC_OPTS        = -H64m -O0 -fasm
66 GhcStage1HcOpts    = -O -fasm
67 GhcStage2HcOpts    = -O0 -fasm
68 GhcLibHcOpts       = -O -fasm
69 SplitObjs          = NO
70 HADDOCK_DOCS       = NO
71 BUILD_DOCBOOK_HTML = NO
72 BUILD_DOCBOOK_PS   = NO
73 BUILD_DOCBOOK_PDF  = NO
74
75 endif
76
77 # -------- Profile the stage2 compiler ---------------------------------------
78
79 ifeq "$(BuildFlavour)" "prof"
80
81 SRC_HC_OPTS        = -H64m -O0 -fasm
82 GhcStage1HcOpts    = -O -fasm
83 GhcStage2HcOpts    = -O -fasm
84 GhcLibHcOpts       = -O -fasm
85
86 GhcLibWays         += p
87 GhcProfiled        = YES
88
89 SplitObjs          = NO
90 HADDOCK_DOCS       = NO
91 BUILD_DOCBOOK_HTML = NO
92 BUILD_DOCBOOK_PS   = NO
93 BUILD_DOCBOOK_PDF  = NO
94
95 endif
96
97
98 # -------- A Development build (stage 1) -------------------------------------
99
100 ifeq "$(BuildFlavour)" "devel1"
101
102 SRC_HC_OPTS        = -H64m -O -fasm
103 GhcLibHcOpts       = -O -dcore-lint
104 GhcStage1HcOpts    = -Rghc-timing -O0 -DDEBUG
105 GhcStage2HcOpts    = -Rghc-timing -O -fasm
106 SplitObjs          = NO
107 HADDOCK_DOCS       = NO
108 BUILD_DOCBOOK_HTML = NO
109 BUILD_DOCBOOK_PS   = NO
110 BUILD_DOCBOOK_PDF  = NO
111
112 endif
113
114 # -------- A Development build (stage 2) -------------------------------------
115
116 ifeq "$(BuildFlavour)" "devel2"
117
118 SRC_HC_OPTS        = -H64m -O -fasm
119 GhcLibHcOpts       = -O -dcore-lint
120 GhcStage1HcOpts    = -Rghc-timing -O -fasm
121 GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
122 SplitObjs          = NO
123 HADDOCK_DOCS       = NO
124 BUILD_DOCBOOK_HTML = NO
125 BUILD_DOCBOOK_PS   = NO
126 BUILD_DOCBOOK_PDF  = NO
127
128 endif
129
130 # -----------------------------------------------------------------------------
131 # Other settings that might be useful
132
133 # profiled RTS
134 #GhcRtsCcOpts =  -pg -g
135
136 # Optimised/profiled RTS
137 #GhcRtsCcOpts = -O2 -pg
138
139 #GhcRtsWithFrontPanel = YES
140 #SRC_HC_OPTS += `gtk-config --libs`
141
142 # NoFib settings
143 NoFibWays =
144 STRIP=: