-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
--- /dev/null
+name: twat
+version: 0.0
+cabal-version: >= 1.8
+author: Michael Orlitzky
+maintainer: Michael Orlitzky <michael@orlitzky.com>
+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