Update validate-settings.mk
[ghc.git] / mk / validate-settings.mk
1 # DO NOT EDIT! Instead, create a file mk/validate.mk, whose settings will
2 # override these. See also mk/custom-settings.mk.
3
4 WERROR = -Werror
5 SRC_CC_WARNING_OPTS =
6 SRC_HC_WARNING_OPTS =
7
8 HADDOCK_DOCS = YES
9
10 #####################
11 # Warnings
12
13 ifneq "$(GccIsClang)" "YES"
14
15 # Debian doesn't turn -Werror=unused-but-set-variable on by default, so
16 # we turn it on explicitly for consistency with other users
17 ifeq "$(GccLT46)" "NO"
18 # Never set the flag on Windows as the host gcc may be too old.
19 ifneq "$(HostOS_CPP)" "mingw32"
20 SRC_CC_WARNING_OPTS += -Werror=unused-but-set-variable
21 endif
22 # gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined
23 SRC_CC_WARNING_OPTS += -Wno-error=inline
24 endif
25
26 else
27
28 # Don't warn about unknown GCC pragmas when using clang
29 SRC_CC_WARNING_OPTS += -Wno-unknown-pragmas
30
31 endif
32
33 SRC_CC_OPTS += $(WERROR) -Wall
34 SRC_HC_OPTS += $(WERROR) -Wall
35
36 GhcStage1HcOpts += -fwarn-tabs
37 GhcStage2HcOpts += -fwarn-tabs
38
39 utils/hpc_dist-install_EXTRA_HC_OPTS += -fwarn-tabs
40
41 #####################
42 SRC_HC_OPTS += -H64m -O0
43
44 GhcStage1HcOpts += -O
45 GhcStage2HcOpts += -O -dcore-lint
46 # Using -O (rather than -O0) here bringes my validate down from 22mins to 16 mins.
47 # Compiling stage2 takes longer, but we gain a faster haddock, faster
48 # running of the tests, and faster building of the utils to be installed
49
50 GhcLibHcOpts += -O -dcore-lint
51
52 # We define DefaultFastGhcLibWays in this style so that the value is
53 # correct even if the user alters DYNAMIC_GHC_PROGRAMS.
54 # Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES,
55 # but with -dynamic-too it's cheap, and makes life easier.
56 DefaultFastGhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
57 DefaultProfGhcLibWays = $(if $(filter $(GhcProfiled),YES),p,)
58
59 ifeq "$(ValidateSpeed)" "FAST"
60 GhcLibWays = $(DefaultFastGhcLibWays)
61 else
62 GhcLibWays := $(filter v dyn,$(GhcLibWays))
63 endif
64 GhcLibWays += $(DefaultProfGhcLibWays)
65 SplitObjs = NO
66 NoFibWays =
67 STRIP_CMD = :
68
69 CHECK_PACKAGES = YES
70
71 # We want to install DPH when validating, so that we can test it
72 InstallExtraPackages = YES
73
74 # dblatex with miktex under msys/mingw can't build the PS and PDF docs,
75 # and just building the HTML docs is sufficient to check that the
76 # markup is correct, so we turn off PS and PDF doc building when
77 # validating.
78 BUILD_DOCBOOK_PS = NO
79 BUILD_DOCBOOK_PDF = NO
80
81 ifeq "$(ValidateHpc)" "YES"
82 GhcStage2HcOpts += -fhpc -hpcdir $(TOP)/testsuite/hpc_output/
83 endif
84 ifeq "$(ValidateSpeed)" "SLOW"
85 GhcStage2HcOpts += -DDEBUG
86 endif
87
88 ######################################################################
89 # Disable some warnings in packages we use
90
91 # Cabal doesn't promise to be warning-free
92 utils/ghc-cabal_dist_EXTRA_HC_OPTS += -w
93 libraries/Cabal/Cabal_dist-boot_EXTRA_HC_OPTS += -w
94 libraries/Cabal/Cabal_dist-install_EXTRA_HC_OPTS += -w
95
96 # Turn off import warnings for bad unused imports
97 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
98 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
99 utils/haddock_dist_EXTRA_HC_OPTS += -fno-warn-unused-imports
100 libraries/vector_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
101
102 # haddock's attoparsec uses deprecated `inlinePerformIO`
103 utils/haddock_dist_EXTRA_HC_OPTS += -fno-warn-deprecations
104
105 # containers uses bitSize at the moment
106 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
107
108 # On Windows, there are also some unused import warnings
109 ifeq "$(HostOS_CPP)" "mingw32"
110 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
111 endif
112
113 # haskeline has warnings about deprecated use of block/unblock
114 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
115 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
116
117 # binary upstream has some warnings, so don't use -Werror for it
118 libraries/binary_dist-boot_EXTRA_HC_OPTS += -Wwarn
119 libraries/binary_dist-install_EXTRA_HC_OPTS += -Wwarn
120
121 # temporarily turn off unused-imports warnings for pretty
122 libraries/pretty_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
123
124 # primitive has a warning about deprecated use of GHC.IOBase
125 libraries/primitive_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
126
127 # temporarily turn off unused-imports warnings for terminfo
128 libraries/terminfo_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-imports
129 libraries/terminfo_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
130
131 # vector has some unused match warnings
132 libraries/vector_dist-install_EXTRA_HC_OPTS += -Wwarn
133
134 # temporarily turn off unused-imports warnings for xhtml
135 libraries/xhtml_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
136
137 libraries/dph/dph-base_dist-install_EXTRA_HC_OPTS += -Wwarn
138 libraries/dph/dph-prim-interface_dist-install_EXTRA_HC_OPTS += -Wwarn
139 libraries/dph/dph-prim-seq_dist-install_EXTRA_HC_OPTS += -Wwarn
140 libraries/dph/dph-prim-par_dist-install_EXTRA_HC_OPTS += -Wwarn
141 libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn
142
143 # transformers has unused function parameters warnings
144 libraries/transformers_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports
145 libraries/transformers_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports
146
147 # Turn of trustworthy-safe warning
148 libraries/base_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
149 libraries/ghc-prim_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
150 libraries/Win32_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
151
152 # Temporarely disable inline rule shadowing warning
153 libraries/template-haskell_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
154
155 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
156 GhcLibHcOpts += -fno-warn-deprecated-flags
157 GhcBootLibHcOpts += -fno-warn-deprecated-flags
158
159 # The warning suppression flag below is a temporary kludge. While working with
160 # modules that contain tabs, please de-tab them so this flag can be eventually
161 # removed. See
162 # http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
163 # for details
164 #
165 GhcLibHcOpts += -fno-warn-tabs
166 GhcBootLibHcOpts += -fno-warn-tabs