Commit bf7f9ea5 authored by ijones's avatar ijones
Browse files

added building executables. that test case now passes

parent ff46829a
......@@ -47,6 +47,7 @@ module Distribution.Package (
showPackageId,
PackageDescription(..),
BuildInfo(..),
Executable(..),
emptyPackageDescription,
parsePackageDesc,
#ifdef DEBUG
......
......@@ -49,7 +49,8 @@ module Distribution.Simple.Build (
import Distribution.Misc (Extension(..), extensionsToNHCFlag, extensionsToGHCFlag)
import Distribution.Setup (CompilerFlavor(..), compilerFlavor, compilerPath)
import Distribution.Package (PackageDescription(..), BuildInfo(..), showPackageId, pkgName)
import Distribution.Package (PackageDescription(..), BuildInfo(..),
showPackageId, pkgName, Executable(..))
import Distribution.Simple.Configure (LocalBuildInfo(..), compiler)
import Distribution.Simple.Utils (rawSystemExit, setupMessage,
die, rawSystemPathExit,
......@@ -111,6 +112,11 @@ buildGHC pref pkg_descr lbi = do
when (not (null (maybe [] cSources (library pkg_descr)))) $
rawSystemExit (compilerPath (compiler lbi)) (maybe [] cSources (library pkg_descr) ++ ["-odir " ++ pref, "-hidir " ++ pref, "-c"])
-- build any executables
sequence_ [rawSystemExit (compilerPath (compiler lbi))
["--make", modPath, "-o", pathJoin [pref, exeName]]
| (Executable exeName modPath _) <- executables pkg_descr]
-- now, build the library
let hObjs = map (++objsuffix) (map dotToSep (maybe [] modules (library pkg_descr)))
cObjs = [file ++ objsuffix | (file, _) <- (map splitExt (maybe [] cSources (library pkg_descr)))]
......
......@@ -5,7 +5,7 @@
** Extensions
- complain if their use makes the code non-portable?
- constructorless data-types
** clean up "make install"
- integrate suggestions from libraries@
** grep for "FIX"
** does clean remove installed-pkg-config and .setup-config or
whatever?
......@@ -15,6 +15,8 @@
** add "clean" to doc?
** add description file format to doc.
** Change name of Setup.description?
** the ./setup -h output should document which commands exist, and
which options are relevant to which commands.
* 1.0
** HC-PKG (see "Depends on HC-PKG" below)
......
module A where
a = 42 :: Int
main = print a
main2 = print a
all:
ghc -Wall --make -i../../:/usr/local/src/HUnit-1.0 Setup.lhs -o setup
clean:
rm -f setup a.out
rm -f setup a.out dist/build/testA
rm -rf ,tmp dist ,tmp2
find . -name "*.o" |xargs rm -f
find . -name "*.hi" |xargs rm -f
......
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