]> gitweb.michael.orlitzky.com - hath.git/commitdiff
Cabalize the project.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 26 Dec 2011 18:04:41 +0000 (13:04 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 26 Dec 2011 18:04:41 +0000 (13:04 -0500)
Setup.hs [new file with mode: 0644]
hath.cabal [new file with mode: 0644]
makefile

diff --git a/Setup.hs b/Setup.hs
new file mode 100644 (file)
index 0000000..9a994af
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/hath.cabal b/hath.cabal
new file mode 100644 (file)
index 0000000..ca43858
--- /dev/null
@@ -0,0 +1,46 @@
+name:           hath
+version:        0.0
+cabal-version:  >= 1.8
+author:         Michael Orlitzky
+maintainer:    Michael Orlitzky <michael@orlitzky.com>
+synopsis:
+  Hath manipulates network blocks in CIDR notation.
+build-type:     Simple
+
+
+executable hath
+  build-depends:
+    base                        == 4.4.*,
+    HUnit                       == 1.2.*,
+    QuickCheck                  == 2.4.*
+
+  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
+    -rtsopts
+    -threaded
+    -optc-O3
+    -optc-march=native
+    -O2
+
+  ghc-prof-options:
+    -prof
+    -auto-all
+    -caf-all
index 8605a8920e23cb967fa940229ba8301e32623328..7eb2938be29252502189ccc32f96128fdc55a465 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,27 +1,17 @@
-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=hath
-
 .PHONY : test
 
-all: $(BIN)
-
-$(BIN): src/*.hs
-       ghc -O2 $(GHC_WARNINGS) --make -o bin/${BIN} src/*.hs
+hath: src/*.hs
+       runghc Setup.hs clean
+       runghc Setup.hs configure --user
+       runghc Setup.hs build
 
 profile: src/*.hs
-       ghc -O2 $(GHC_WARNINGS) -prof -auto-all --make -o bin/$(BIN) src/*.hs
+       runghc Setup.hs clean
+       runghc Setup.hs configure --user --enable-executable-profiling
+       runghc Setup.hs build
 
 clean:
-       rm -f bin/$(BIN)
-       rm -f src/*.hi
-       rm -f src/*.o
-       rm -f *.prof
+       runghc Setup.hs clean
 
 test:
        runghc -i"src" test/TestSuite.hs