diff --git a/simple-sql-parser.cabal b/simple-sql-parser.cabal
index cac3947..8169085 100644
--- a/simple-sql-parser.cabal
+++ b/simple-sql-parser.cabal
@@ -19,6 +19,10 @@ source-repository head
   type:                git
   location:            https://github.com/JakeWheat/simple-sql-parser.git
 
+Flag sqlindent
+  Description: Build SQLIndent exe
+  Default:     False
+
 library
   exposed-modules:     Language.SQL.SimpleSQL.Pretty,
                        Language.SQL.SimpleSQL.Parser,
@@ -67,3 +71,19 @@ Test-Suite Tests
   other-extensions:    TupleSections,OverloadedStrings
   default-language:    Haskell2010
   ghc-options:         -Wall
+
+executable SQLIndent
+  main-is:             SQLIndent.lhs
+  hs-source-dirs:      .,tools
+  Build-Depends:       base >=4.6 && <4.7,
+                       parsec >=3.1 && <3.2,
+                       mtl >=2.1 && <2.2,
+                       pretty >= 1.1 && < 1.2,
+                       haskell-src-exts >= 1.14 && < 1.15,
+                       simple-sql-parser
+  default-language:    Haskell2010
+  ghc-options:         -Wall
+  if flag(sqlindent)
+    buildable:         True
+  else
+    buildable:         False
diff --git a/tools/PrettyIt.lhs b/tools/SQLIndent.lhs
similarity index 84%
rename from tools/PrettyIt.lhs
rename to tools/SQLIndent.lhs
index b2b63a5..f34ed75 100644
--- a/tools/PrettyIt.lhs
+++ b/tools/SQLIndent.lhs
@@ -3,7 +3,6 @@
 
 > import Language.SQL.SimpleSQL.Pretty
 > import Language.SQL.SimpleSQL.Parser
-> import Data.List
 
 > main :: IO ()
 > main = do
@@ -14,4 +13,4 @@
 >              either (error . peFormattedError)
 >                     (putStrLn . prettyQueryExprs)
 >                     $ parseQueryExprs f Nothing src
->       _ -> error "please pass filename to prettify"
+>       _ -> error "please pass filename to indent"