Merge remote-tracking branch 'origin/master' into type-nats
[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 # bytestring has identities at the moment
70 libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-identities
71
72 # Temporarily turn off unused-do-bind warnings for the time package
73 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-do-bind
74 # Temporary: mkTyCon is deprecated
75 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
76 # On Windows, there are also some unused import warnings
77 libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
78
79 # haskeline has warnings about deprecated use of block/unblock
80 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
81 libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
82
83 # Temporarily turn off unused-import warnings for the binary package
84 libraries/binary_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-imports
85 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities
86
87 # Temporarily turn off -Werror for some Hoopl modules that have
88 # non-exhaustive pattern-match warnings
89 libraries/hoopl/src/Compiler/Hoopl/Util_HC_OPTS += -Wwarn
90 libraries/hoopl/src/Compiler/Hoopl/GraphUtil_HC_OPTS += -Wwarn
91 libraries/hoopl/src/Compiler/Hoopl/MkGraph_HC_OPTS += -Wwarn
92 libraries/hoopl/src/Compiler/Hoopl/XUtil_HC_OPTS += -Wwarn
93 libraries/hoopl/src/Compiler/Hoopl/Pointed_HC_OPTS += -Wwarn
94 libraries/hoopl/src/Compiler/Hoopl/Passes/Dominator_HC_OPTS += -Wwarn
95
96 # primitive has a warning about deprecated use of GHC.IOBase
97 libraries/primitive_dist-install_EXTRA_HC_OPTS += -Wwarn
98
99 # vector has some unused match warnings
100 libraries/vector_dist-install_EXTRA_HC_OPTS += -Wwarn
101
102 libraries/dph/dph-base_dist-install_EXTRA_HC_OPTS += -Wwarn
103 libraries/dph/dph-prim-interface_dist-install_EXTRA_HC_OPTS += -Wwarn
104 libraries/dph/dph-prim-seq_dist-install_EXTRA_HC_OPTS += -Wwarn
105 libraries/dph/dph-prim-par_dist-install_EXTRA_HC_OPTS += -Wwarn
106 libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn
107
108 # We need to turn of deprecated warnings for SafeHaskell transition
109 libraries/array_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
110 libraries/binary_dist-install_EXTRA_HC_OPTS += -fno-warn-warnings-deprecations
111 libraries/binary/src/Data/Binary/Builder/Base_HC_OPTS += -fno-warn-warnings-deprecations
112 libraries/binary/src/Data/Binary/Get_HC_OPTS += -fno-warn-warnings-deprecations
113
114 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
115 GhcLibHcOpts += -fno-warn-deprecated-flags
116 GhcBootLibHcOpts += -fno-warn-deprecated-flags
117