From: Michael Orlitzky Date: Sun, 11 Dec 2011 14:48:28 +0000 (-0500) Subject: Use cabal to build the binary and documentation. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhalcyon.git;a=commitdiff_plain;h=ea3a5b5f48baf757d5c5c2d1db64f669001185f1 Use cabal to build the binary and documentation. --- diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/makefile b/makefile index 6f9eadf..8bd7248 100644 --- a/makefile +++ b/makefile @@ -1,40 +1,19 @@ -GHC_WARNINGS := -Wall -GHC_WARNINGS += -fwarn-hi-shadowing -GHC_WARNINGS += -fwarn-missing-signatures -GHC_WARNINGS += -fwarn-name-shadowing -GHC_WARNINGS += -fwarn-orphans -GHC_WARNINGS += -fwarn-type-defaults - -BIN=bin/twat - .PHONY : doc test -all: $(BIN) - -$(BIN): src/Twitter/*.hs src/*.hs - ghc -O2 $(GHC_WARNINGS) --make -o $(BIN) src/Twitter/*.hs src/*.hs - -profile: src/Twitter/*.hs src/*.hs - ghc -O2 $(GHC_WARNINGS) -prof -auto-all --make -o $(BIN) src/Twitter/*.hs src/*.hs +twat: src/*.hs src/Twitter/*.hs + runghc Setup.hs clean + runghc Setup.hs configure --user + runghc Setup.hs build clean: - rm -f $(BIN) - rm -f src/*.hi - rm -f src/Twitter/*.hi - rm -f src/*.o - rm -f src/Twitter/*.o - rm -f *.prof + runghc Setup.hs clean test: runghc -i"src" test/TestSuite.hs +# Neither 'haddock' nor 'hscolour' seem to work properly. doc: - mkdir -p doc - haddock -i /usr/share/doc/haxml-1.13.2/html/HaXml.haddock \ - -i /usr/share/doc/ghc-6.8.2/libraries/base/base.haddock \ - -i /usr/share/doc/curl-1.3.5/html/curl.haddock \ - -i /usr/share/doc/regex-compat-0.71.0.1/html/regex-compat.haddock \ - -i /usr/share/doc/ghc-6.8.2/libraries/process/process.haddock \ - -h \ - -o doc/ \ - src/*.hs src/Twitter/*.hs + runghc Setup.hs hscolour --executables + runghc Setup.hs haddock --internal \ + --executables \ + --hyperlink-source diff --git a/twat.cabal b/twat.cabal new file mode 100644 index 0000000..96779ae --- /dev/null +++ b/twat.cabal @@ -0,0 +1,43 @@ +name: twat +version: 0.0 +cabal-version: >= 1.8 +author: Michael Orlitzky +maintainer: Michael Orlitzky +synopsis: + Twat twats tweets so you don't have to twitter. +build-type: Simple + +executable twat + build-depends: + base == 4.4.*, + curl == 1.3.*, + HaXml == 1.22.*, + HUnit == 1.2.*, + MissingH == 1.*, + process == 1.*, + old-time == 1.*, + regex-compat == 0.* + + + main-is: + Main.hs + + hs-source-dirs: + src/ + + 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 + -funbox-strict-fields + -fexcess-precision + -fno-spec-constr-count + -optc-O3 + -optc-march=native