Separate warning flags from other flags in 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 # Debian doesn't turn -Werror=unused-but-set-variable on by default, so
14 # we turn it on explicitly for consistency with other users
15 ifeq "$(GccLT46)" "NO"
16 SRC_CC_WARNING_OPTS += -Werror=unused-but-set-variable
17 # gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined
18 SRC_CC_WARNING_OPTS += -Wno-error=inline
19 endif
20
21 SRC_CC_OPTS += $(WERROR) -Wall
22 SRC_HC_OPTS += $(WERROR) -Wall
23
24 GhcStage1HcOpts += -fwarn-tabs
25 GhcStage2HcOpts += -fwarn-tabs
26
27 #####################
28 SRC_HC_OPTS += -H64m -O0
29
30 GhcStage1HcOpts += -O
31 GhcStage2HcOpts += -O -dcore-lint
32 # Using -O (rather than -O0) here bringes my validate down from 22mins to 16 mins.
33 # Compiling stage2 takes longer, but we gain a faster haddock, faster
34 # running of the tests, and faster building of the utils to be installed
35
36 GhcLibHcOpts += -O -dcore-lint
37
38 # We define DefaultFastGhcLibWays in this style so that the value is
39 # correct even if the user alters DYNAMIC_BY_DEFAULT
40 DefaultFastGhcLibWays = $(if $(filter $(DYNAMIC_BY_DEFAULT),YES),dyn,v)
41
42 ifeq "$(ValidateSpeed)" "FAST"
43 GhcLibWays = $(DefaultFastGhcLibWays)
44 else
45 GhcLibWays := $(filter v dyn,$(GhcLibWays))
46 endif
47 SplitObjs = NO
48 NoFibWays =
49 STRIP_CMD = :
50
51 CHECK_PACKAGES = YES
52
53 # We want to install DPH when validating, so that we can test it
54 InstallExtraPackages = YES
55
56 # dblatex with miktex under msys/mingw can't build the PS and PDF docs,
57 # and just building the HTML docs is sufficient to check that the
58 # markup is correct, so we turn off PS and PDF doc building when
59 # validating.
60 BUILD_DOCBOOK_PS = NO
61 BUILD_DOCBOOK_PDF = NO
62
63 ifeq "$(ValidateHpc)" "YES"
64 GhcStage2HcOpts += -fhpc -hpcdir $(TOP)/testsuite/hpc_output/
65 endif
66 ifeq "$(ValidateSpeed)" "SLOW"
67 GhcStage2HcOpts += -DDEBUG
68 endif
69
70 ######################################################################
71 # Disable some warnings in packages we use
72
73 # Cabal doesn't promise to be warning-free
74 utils/ghc-cabal_dist_EXTRA_HC_OPTS += -w
75 libraries/Cabal/Cabal_dist-boot_EXTRA_HC_OPTS += -w
76 libraries/Cabal/Cabal_dist-install_EXTRA_HC_OPTS += -w
77
78 # Temporarily turn off incomplete-pattern warnings for containers
79 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-incomplete-patterns
80
81 # Temporarily turn off pointless-pragma warnings for containers
82 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-pointless-pragmas
83
84 # bytestring has identities at the moment
85 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-identities
86
87 # bytestring uses bitSize at the moment
88 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
89
90 # containers uses bitSize at the moment
91 libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
92
93 # Temporarily turn off unused-do-bind warnings for the time package
94 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-do-bind
95 # Temporary: mkTyCon is deprecated
96 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
97 # On Windows, there are also some unused import warnings
98 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
99
100 # haskeline has warnings about deprecated use of block/unblock
101 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
102 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
103
104 # Temporarily turn off unused-import warnings for the binary package
105 libraries/binary_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-imports
106 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
107
108 # temporarily turn off -Werror for mtl
109 libraries/mtl_dist-install_EXTRA_HC_OPTS += -Wwarn
110
111 # primitive has a warning about deprecated use of GHC.IOBase
112 libraries/primitive_dist-install_EXTRA_HC_OPTS += -Wwarn
113
114 # temporarily turn off -Werror for transformers
115 libraries/transformers_dist-install_EXTRA_HC_OPTS += -Wwarn
116
117 # vector has some unused match warnings
118 libraries/vector_dist-install_EXTRA_HC_OPTS += -Wwarn
119
120 libraries/dph/dph-base_dist-install_EXTRA_HC_OPTS += -Wwarn
121 libraries/dph/dph-prim-interface_dist-install_EXTRA_HC_OPTS += -Wwarn
122 libraries/dph/dph-prim-seq_dist-install_EXTRA_HC_OPTS += -Wwarn
123 libraries/dph/dph-prim-par_dist-install_EXTRA_HC_OPTS += -Wwarn
124 libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn
125
126 # We need to turn of deprecated warnings for SafeHaskell transition
127 libraries/array_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
128 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
129 libraries/binary/src/Data/Binary/Builder/Base_HC_OPTS += -fno-warn-warnings-deprecations
130 libraries/binary/src/Data/Binary/Get_HC_OPTS += -fno-warn-warnings-deprecations
131
132 # Temporarely disable inline rule shadowing warning
133 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
134 libraries/template-haskell_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
135
136 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
137 GhcLibHcOpts += -fno-warn-deprecated-flags
138 GhcBootLibHcOpts += -fno-warn-deprecated-flags