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