Commit a7ab0fe8 authored by ijones's avatar ijones
Browse files

created Simple subdir, compile, and toward -Wall clean

Added the Simple directory
Moved Build and Install to SImple
moved defaultMain to Simple/Default
toward -Wall cleanliness
parent 577bca0c
......@@ -45,17 +45,19 @@ module Main where
-- Import everything, since we want to test the compilation of them:
import Distribution.Install()
import Distribution.Build()
import Distribution.Version()
import Distribution.UseConfig()
import Distribution.Misc()
import Distribution.Package()
import Distribution.Simple.Default()
import Distribution.Simple.Install()
import Distribution.Simple.Build()
main :: IO ()
main = putStrLn "compile successful"
-- Local Variables:
-- compile-command: "ghc --make ModuleTest.hs -o moduleTest"
-- compile-command: "ghc -i../:/usr/local/src/HUnit-1.0 -Wall --make ModuleTest.hs -o moduleTest"
-- End:
......@@ -41,40 +41,15 @@ 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. -}
module Distribution.Setup (parseArgs, defaultMain) where
-- Base
import System(getArgs)
module Distribution.Setup (parseArgs, Action(..)) where
-- Local
import Distribution.Build(build)
import Distribution.Install(install)
import Distribution.Misc(LocalBuildInfo, getPersistBuildConfig)
import Distribution.Package(PackageConfig)
-- |Reads local build info, executes function
doBuildInstall :: (PackageConfig -> LocalBuildInfo -> IO ()) -- ^function to apply
-> PackageConfig
-> IO ()
doBuildInstall f pkgConf
= do lbi <- getPersistBuildConfig
f pkgConf lbi
import Distribution.Misc(LocalBuildInfo)
-- |Parse the standard command-line arguments
parseArgs :: [String] -> CommandLineOpts
parseArgs _ = (BuildCmd, [])
defaultMain :: PackageConfig -> IO ()
defaultMain p
= do args <- getArgs
case parseArgs args of
(BuildCmd, _) -> doBuildInstall build p
(InstallCmd, _) -> doBuildInstall install p
(PackageInfoCmd, _) -> print p
return ()
-- ------------------------------------------------------------
-- * command line
-- ------------------------------------------------------------
......
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Build
-- Module : Distribution.Simple.Build
-- Copyright : Isaac Jones 2003-2004
--
-- Maintainer : Isaac Jones <ijones@syntaxpolice.org>
......@@ -39,7 +39,7 @@ 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. -}
module Distribution.Build where
module Distribution.Simple.Build where
import Distribution.Package(PackageConfig)
import Distribution.Misc(LocalBuildInfo)
......
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Default
-- Copyright : Isaac Jones 2003-2004
--
-- Maintainer : Isaac Jones <ijones@syntaxpolice.org>
-- Stability : alpha
-- Portability : GHC
--
-- Explanation: <FIX>
-- WHERE DOES THIS MODULE FIT IN AT A HIGH-LEVEL <FIX>
{- Copyright (c) 2003-2004, Isaac Jones
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 Isaac Jones 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. -}
module Distribution.Simple.Default (defaultMain)
where
-- Base
import System(getArgs)
import Distribution.Package(PackageConfig(..))
import Distribution.Setup(parseArgs, Action(..))
import Distribution.Misc(LocalBuildInfo(..), getPersistBuildConfig)
import Distribution.Simple.Build(build)
import Distribution.Simple.Install(install)
-- |Reads local build info, executes function
doBuildInstall :: (PackageConfig -> LocalBuildInfo -> IO ()) -- ^function to apply
-> PackageConfig
-> IO ()
doBuildInstall f pkgConf
= do lbi <- getPersistBuildConfig
f pkgConf lbi
defaultMain :: PackageConfig -> IO ()
defaultMain p
= do args <- getArgs
case parseArgs args of
(BuildCmd, _) -> doBuildInstall build p
(InstallCmd, _) -> doBuildInstall install p
(PackageInfoCmd, _) -> print p
return ()
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Install
-- Module : Distribution.Simple.Install
-- Copyright : Isaac Jones 2003-2004
--
-- Maintainer : Isaac Jones <ijones@syntaxpolice.org>
......@@ -41,7 +41,7 @@ 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. -}
module Distribution.Install(install) where
module Distribution.Simple.Install(install) where
import Distribution.Package(PackageConfig)
import Distribution.Misc(LocalBuildInfo)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment