Skip to content

Commit

Permalink
cabal-in-cabal (updated makefile)
Browse files Browse the repository at this point in the history
** 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
  • Loading branch information
SyntaxPolice committed Jun 17, 2004
1 parent 5138ff5 commit f9271bc
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 6 deletions.
46 changes: 40 additions & 6 deletions Makefile
@@ -1,19 +1,53 @@
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
Expand Down
17 changes: 17 additions & 0 deletions README
@@ -0,0 +1,17 @@
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.
32 changes: 32 additions & 0 deletions Setup.lhs
@@ -0,0 +1,32 @@
#!/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

0 comments on commit f9271bc

Please sign in to comment.