From: Michael Orlitzky Date: Sun, 28 Aug 2022 16:35:26 +0000 (-0400) Subject: makefile,email-validator.cabal: move ghc-options to the makefile. X-Git-Tag: 1.0.1~6 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=bd17e086bf868facb54e6f957643fa2d61defc11;p=email-validator.git makefile,email-validator.cabal: move ghc-options to the makefile. --- diff --git a/email-validator.cabal b/email-validator.cabal index 61f2809..c5c2a7e 100644 --- a/email-validator.cabal +++ b/email-validator.cabal @@ -70,18 +70,6 @@ executable email-validator EmailAddress Paths_email_validator - ghc-options: - -Weverything - -Wno-implicit-prelude - -Wno-safe - -Wno-unsafe - -Wno-all-missed-specialisations - -rtsopts - -threaded - -optc-O3 - -optc-march=native - -O2 - test-suite testsuite type: exitcode-stdio-1.0 @@ -103,19 +91,6 @@ test-suite testsuite other-modules: EmailAddress - -- It's not entirely clear to me why I have to reproduce all of this. - ghc-options: - -Weverything - -Wno-implicit-prelude - -Wno-safe - -Wno-unsafe - -Wno-all-missed-specialisations - -rtsopts - -threaded - -optc-O3 - -optc-march=native - -O2 - test-suite doctests type: exitcode-stdio-1.0 @@ -126,25 +101,6 @@ test-suite doctests -- Additional test dependencies. doctest >= 0.9 - -- It's not entirely clear to me why I have to reproduce all of this. - ghc-options: - -Wall - -fwarn-hi-shadowing - -fwarn-missing-signatures - -fwarn-name-shadowing - -fwarn-orphans - -fwarn-type-defaults - -fwarn-tabs - -fwarn-incomplete-record-updates - -fwarn-monomorphism-restriction - -fwarn-unused-do-bind - -rtsopts - -threaded - -optc-O3 - -optc-march=native - -O2 - - source-repository head type: git diff --git a/makefile b/makefile index 5df18d2..41b916c 100644 --- a/makefile +++ b/makefile @@ -2,12 +2,26 @@ PN = email-validator BIN = dist/build/$(PN)/$(PN) TESTSUITE_BIN = dist/build/testsuite/testsuite +# Append these warnings to the HCFLAGS environment variable that gets +# passed as options to GHC. We want to see the warnings while developing +# but don't want them hard-coded in the cabal file for end users. +HCFLAGS += -Weverything \ + -Wno-implicit-prelude \ + -Wno-safe \ + -Wno-unsafe \ + -Wno-all-missed-specialisations \ + -Wno-prepositive-qualified-module \ + -Wno-missing-safe-haskell-mode \ + -Wno-missing-deriving-strategies \ + -rtsopts \ + -threaded + .PHONY : test dist hlint $(BIN): $(PN).cabal src/*.hs runghc Setup.hs clean runghc Setup.hs configure --user - runghc Setup.hs build + runghc Setup.hs build --ghc-options="${HCFLAGS}" doc: src/*.hs runghc Setup.hs configure --user @@ -21,7 +35,7 @@ clean: $(TESTSUITE_BIN): $(PN).cabal src/*.hs test/*.hs runghc Setup.hs configure --user --enable-tests - runghc Setup.hs build + runghc Setup.hs build --ghc-options="${HCFLAGS}" check: $(BIN) $(TESTSUITE_BIN) runghc Setup.hs test