diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Changelog for doctest-driver-gen
+
+## 0.1.0.0 (Initial)
+
+doctest-driver-gen is a doctest driver file generator. It lets you automatically generate driver file for doctest's cabal integration.
+
+### Usage
+
+    {-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}
+
+Make your driver file with the content. `OPTION` is doctest's option. You can see help with `doctest --help`.
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,30 @@
+Copyright Hexirp (c) 2017
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of Hexirp nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -0,0 +1,17 @@
+# doctest-driver-gen
+
+[![Build Status](https://travis-ci.org/Hexirp/doctest-driver-gen.svg?branch=master)](https://travis-ci.org/Hexirp/doctest-driver-gen)
+
+doctest-driver-gen is a doctest driver file generator. It lets you automatically generate driver file for doctest's cabal integration.
+
+## Usage
+
+```haskell
+{-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}
+```
+
+Make your driver file with the content. `OPTION` is doctest's option. You can see help with `doctest --help`.
+
+## Motivation
+
+This package was motivated by [doctest-discover](https://hackage.haskell.org/package/doctest-discover).
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/app/Main.hs b/app/Main.hs
new file mode 100644
--- /dev/null
+++ b/app/Main.hs
@@ -0,0 +1,8 @@
+module Main where
+ import Prelude
+ import System.Environment (getArgs)
+
+ import Test.DocTest.Gen (ddgen)
+
+ main :: IO ()
+ main = getArgs >>= ddgen
diff --git a/doctest-driver-gen.cabal b/doctest-driver-gen.cabal
new file mode 100644
--- /dev/null
+++ b/doctest-driver-gen.cabal
@@ -0,0 +1,52 @@
+name:                doctest-driver-gen
+version:             0.1.0.0
+synopsis:            Generate doctest-driver.hs
+description:         doctest-driver-gen is a doctest driver file generator.
+                     It lets you automatically generate driver file for
+                     doctest's cabal integration.
+homepage:            https://github.com/Hexirp/doctest-driver-gen#readme
+license:             BSD3
+license-file:        LICENSE
+author:              Hexirp
+maintainer:          https://github.com/Hexirp/doctest-driver-gen/issues
+copyright:           2017 Hexirp
+category:            Testing
+build-type:          Simple
+extra-source-files:  README.md, CHANGELOG.md
+cabal-version:       >=1.10
+
+library
+  hs-source-dirs:      src
+  exposed-modules:     Test.DocTest.Gen
+  build-depends:       base >= 4 && < 5
+                       -- doctest 0.12 is disabled.
+                     , doctest >= 0.8 && < 0.12 || >= 0.13 && < 0.14
+  ghc-options:         -Wall
+  default-language:    Haskell2010
+
+executable doctest-driver-gen
+  hs-source-dirs:      app
+  main-is:             Main.hs
+  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N
+  build-depends:       base
+                     , doctest-driver-gen
+  default-language:    Haskell2010
+
+test-suite doctest-driver-gen-test
+  type:                exitcode-stdio-1.0
+  hs-source-dirs:      test
+  main-is:             doctest-driver.hs
+  build-depends:       base
+                     , doctest
+                     , doctest-driver-gen
+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
+  default-language:    Haskell2010
+
+source-repository head
+  type:     git
+  location: https://github.com/Hexirp/doctest-driver-gen
+
+source-repository this
+  type:     git
+  location: https://github.com/Hexirp/doctest-driver-gen
+  tag:      0.1.0.0
diff --git a/src/Test/DocTest/Gen.hs b/src/Test/DocTest/Gen.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/DocTest/Gen.hs
@@ -0,0 +1,48 @@
+-- |
+-- Module      : Test.DocTest.Gen
+--
+-- Stability   : experimental
+-- Portability : portable
+--
+-- Provide doctest-driver-gen's functions.
+module Test.DocTest.Gen where
+ import Prelude
+ import Data.List (unlines)
+
+ -- * Usage
+
+ -- $usage
+ --
+ -- > {-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}
+ --
+ -- Make your driver file with the content.
+ -- @OPTION@ is doctest's option. You can see help with @doctest --help@.
+
+ -- * Documentation
+
+ -- | Run doctest-driver-gen with given list of arguments.
+ ddgen :: [String] -> IO ()
+ ddgen (src : inp : out : opts) = ddgen_output src inp out opts
+ ddgen _                        = ddgen_usage
+
+ -- | Output driver file.
+ ddgen_output
+  :: String -- ^ Name of the original source file.
+  -> String -- ^ Name of the file holding the input.
+  -> String -- ^ Name of the file where this should write its output to.
+  -> [String] -- ^ Options for doctest.
+  -> IO ()
+ ddgen_output _ _ out opts = writeFile out $ unlines [
+  "import Test.DocTest",
+  "",
+  "main :: IO ()",
+  "main = doctest " ++ show opts]
+
+ -- | Print doctest-driver-gen's usage.
+ ddgen_usage :: IO ()
+ ddgen_usage = putStrLn $ unlines [
+  "Usage:",
+  "  {-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}",
+  "",
+  "Make your driver file with the content.",
+  "\"OPTION\" is doctest's option. You can see help with \"doctest --help\"."]
diff --git a/test/doctest-driver.hs b/test/doctest-driver.hs
new file mode 100644
--- /dev/null
+++ b/test/doctest-driver.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -F -pgmF doctest-driver-gen -optF src #-}
