Commit f9271bce authored by ijones's avatar ijones
Browse files

cabal-in-cabal (updated makefile)

** Wrote Setup wrapper for cabal itself, but it kinda requires
   a bootstrap makefile.
** added a bunch of targets to the makefile to do the Right Thing
parent 5138ff53
all: main
GHCFLAGS= -itest/HUnit-1.0/src --make -Wall
PREF=/usr/local
main:
ghc -Wall --make -i../:test/HUnit-1.0/src Distribution/ModuleTest -o moduleTest
all: moduleTest
tests:
cd test/A && make
cd test/HUnit-1.0 && make
# build the library itself
setup:
ghc $(GHCFLAGS) Setup -o setup
build: hunitInstall config
./setup build
config: setup
./setup configure --prefix=$(PREF)
install: build
./setup install
clean:
-rm -f Distribution/*.{o,hi} Distribution/Simple/*.{o,hi}
-rm -f library-infrastructure--darcs.tar.gz
-rm -rf setup *.{o,hi} moduleTest dist installed-pkg-config
remove:
ghc-pkg -r Cabal-0.1
ghc-pkg -r HUnit-1.0
rm -r $(PREF)/lib/{Cabal-0.1,HUnit-1.0}
# dependencies:
hunit:
cd test/HUnit-1.0 && make && ./setup configure --prefix=$(PREF) && ./setup build
hunitInstall: hunit
cd test/HUnit-1.0 && ./setup install
# testing...
moduleTest:
ghc $(GHCFLAGS) Distribution/ModuleTest -o moduleTest
tests: moduleTest
cd test/A && make
check: tests main
./moduleTest
# distribution...
pushall:
darcs push --all ijones@monk.syntaxpolice.org:/home/ijones/public_html/darcs_repos/library-infrastructure
darcs push --all ijones@cvs.haskell.org:/home/ijones/library-infrastructure
......
Cabal home page:
http://www.haskell.org/cabal
Quirky things about the build system
* The Makefile wraps the standard Cabal setup script; the Makefile is
a convinience for bootstrapping the system. "sudo make install"
should handle HUnit, generate the setup script, configure, build,
install, and register it in a standard location.
* HUnit is included both as a test case for Cabal, and because Cabal
uses HUnit for testing. Don't panic.
* HUnit also uses the standard setup script interface, and has to get
installed and registered before the build setup of Cabal. The
install target of the Makefile does everything in the right order.
#!/usr/bin/runhugs
> module Main where
> import Distribution.Simple
> pkg_descr = emptyPackageDescription {
> package = PackageIdentifier "Cabal" (Version [0,1] []),
> allModules = ["Distribution.Package",
> "Distribution.Version",
> "Distribution.Misc",
> "Distribution.Setup",
> "Distribution.InstalledPackageInfo",
> "Distribution.Make",
>
> "Distribution.Simple",
> "Distribution/Simple.Build",
> "Distribution.Simple.Install",
> "Distribution.Simple.SrcDist",
> "Distribution.Simple.Configure",
> "Distribution.Simple.Utils",
> "Distribution.Simple.Register",
> "Distribution.Simple.GHCPackageConfig",
> "Distribution.GetOpt"],
>
> buildDepends = [Dependency "haskell-src" AnyVersion,
> Dependency "HUnit-1.0" AnyVersion
> ]
> }
> main :: IO ()
> main = do defaultMain pkg_descr
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