X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=libraries%2FMakefile;h=7ac12431ed029050e3170ce3c7bd3de18076730a;hp=417e37d636970af321a985ab8e3dfc36d8647327;hb=430453c5131592b6147a80202dc5f7fbe3f3d5fd;hpb=d0d51c8b13ea9168ee22fbb7d89b1694f317277c diff --git a/libraries/Makefile b/libraries/Makefile index 417e37d..7ac1243 100644 --- a/libraries/Makefile +++ b/libraries/Makefile @@ -9,6 +9,16 @@ # # make clean.library. # make build.library. +# +# or the following is equivalent: +# +# make rebuild.library. +# +# To add a new library to the tree, do +# +# darcs get http://darcs.haskell.org/packages/foo +# [ -e foo/configure.ac ] && ( cd foo && autoreconf ) +# make build.library.foo .PHONY: default_target @@ -23,7 +33,8 @@ TOP=. include $(TOP)/mk/boilerplate.mk endif -SUBDIRS = base filepath haskell98 pretty template-haskell readline Cabal +SUBDIRS = base old-locale old-time directory process filepath pretty \ + template-haskell readline Cabal random haskell98 ifeq "$(GhcLibsWithUnix)" "YES" SUBDIRS += unix @@ -64,6 +75,7 @@ SUBDIRS += $(wildcard arrows) ifeq "$(GhcLibsWithObjectIO)" "YES" SUBDIRS += $(wildcard ObjectIO) endif +SUBDIRS += $(wildcard parallel) endif # ----------------------------------------------------------------------------- @@ -90,7 +102,10 @@ CONFIGURE_OPTS += --enable-split-objs CONFIGURE_STAMP_EXTRAS := $(CONFIGURE_STAMP_EXTRAS)-splitting endif -BOOTSTRAPPING_STAMPS = $(addprefix stamp/bootstrapping.,Cabal filepath pretty) +BOOTSTRAP_LIBS = Cabal filepath +BOOTSTRAP_STAMPS = $(addprefix stamp/bootstrapping.,$(BOOTSTRAP_LIBS)) +BOOTSTRAP_INC_1_UP = $(addprefix -i../bootstrapping.,$(BOOTSTRAP_LIBS)) +BOOTSTRAP_INC_2_UP = $(addprefix -i../../bootstrapping.,$(BOOTSTRAP_LIBS)) .PHONY: subdirs @@ -99,7 +114,7 @@ subdirs: .PHONY: boot -boot: $(BOOTSTRAPPING_STAMPS) ifBuildable/ifBuildable \ +boot: $(BOOTSTRAP_STAMPS) ifBuildable/ifBuildable \ $(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/setup/Setup) \ installPackage/installPackage @@ -110,24 +125,20 @@ boot: $(BOOTSTRAPPING_STAMPS) ifBuildable/ifBuildable \ # We ought to be depending on %/Setup.*hs, but make makes that difficult. $(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/setup/Setup): \ -%/setup/Setup: $(BOOTSTRAPPING_STAMPS) +%/setup/Setup: $(BOOTSTRAP_STAMPS) -$(RM) -rf $*/setup mkdir $*/setup $(CP) $*/Setup.*hs $*/setup - cd $*/setup && $(GHC) -i../../bootstrapping.Cabal \ - -i../../bootstrapping.filepath \ - -i../../bootstrapping.pretty \ - -Wall -cpp --make Setup.*hs -o Setup + cd $*/setup && $(GHC) -Wall -cpp --make Setup.*hs -o Setup \ + $(BOOTSTRAP_INC_2_UP) -installPackage/installPackage: installPackage.hs $(BOOTSTRAPPING_STAMPS) +installPackage/installPackage: installPackage.hs $(BOOTSTRAP_STAMPS) -$(RM) -rf installPackage mkdir installPackage $(CP) installPackage.hs installPackage/ cd installPackage && $(GHC) -Wall -cpp \ --make installPackage -o installPackage \ - -i../bootstrapping.Cabal \ - -i../bootstrapping.filepath \ - -i../bootstrapping.pretty + $(BOOTSTRAP_INC_1_UP) ifBuildable/ifBuildable: ifBuildable.hs -$(RM) -rf ifBuildable @@ -135,7 +146,7 @@ ifBuildable/ifBuildable: ifBuildable.hs $(CP) ifBuildable.hs ifBuildable/ cd ifBuildable && $(GHC) -Wall --make ifBuildable -o ifBuildable -$(BOOTSTRAPPING_STAMPS): stamp/bootstrapping.%: +$(BOOTSTRAP_STAMPS): stamp/bootstrapping.%: $(RM) -rf bootstrapping.$* $(CP) -R $* bootstrapping.$* $(FIND) bootstrapping.$* \( -name "*.o" -o -name "*.hi" \) \ @@ -150,6 +161,11 @@ ifneq "$(NO_HADDOCK_DOCS)" "YES" all: doc endif +.PHONY: rebuild.library.% + +$(foreach SUBDIR,$(SUBDIRS),rebuild.library.$(SUBDIR)):\ +rebuild.library.%: clean.library.% build.library.% + build: $(foreach SUBDIR,$(SUBDIRS),build.library.$(SUBDIR)) build: installPackage/installPackage @@ -167,7 +183,8 @@ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup -$(RM) -f stamp/configure.library.*.$* $*/unbuildable ( cd $* && setup/Setup configure \ $(CONFIGURE_OPTS) \ - --prefix=$(prefix) \ + --prefix='$$topdir' \ + --libsubdir='$$compiler/lib/$$pkgid' \ --with-compiler=../../compiler/ghc-inplace$(dot_bat) \ --with-hc-pkg=../../utils/ghc-pkg/ghc-pkg-inplace$(dot_bat) \ --with-hsc2hs=../../utils/hsc2hs/hsc2hs-inplace$(dot_bat) \ @@ -190,6 +207,13 @@ build.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ $(addprefix --ghc-option=,$(GhcLibHcOpts)) ifBuildable/ifBuildable $* setup/Setup register --inplace +$(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/CabalMakefile):\ +%/CabalMakefile: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ + %/setup/Setup ifBuildable/ifBuildable + $(RM) $*/CabalMakefile + ifBuildable/ifBuildable $* setup/Setup makefile -f CabalMakefile \ + $(addprefix --ghc-option=,$(GhcLibHcOpts)) + .PHONY: doc DOC_SUBDIRS = $(filter-out haskell98,$(SUBDIRS)) @@ -204,16 +228,17 @@ doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ .PHONY: install install-docs install.library.% -INSTALL_DIR=$(prefix)/share/ghc/doc/html/ +ROOT=$(prefix)/share/ghc/doc/html/ install: $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)) ifneq "$(NO_HADDOCK_DOCS)" "YES" - $(INSTALL_DATA) index.html doc-index.html $(INSTALL_DIR) - $(INSTALL_SCRIPT) gen_contents_index $(INSTALL_DIR) + $(INSTALL_DIR) $(ROOT) + $(INSTALL_DATA) index.html doc-index.html $(ROOT) + $(INSTALL_SCRIPT) gen_contents_index $(ROOT) # Hacks: - $(INSTALL_DATA) $(prefix)/share/ghc/doc/html/base/*.css $(INSTALL_DIR) - $(INSTALL_DATA) $(prefix)/share/ghc/doc/html/base/*.js $(INSTALL_DIR) - $(INSTALL_DATA) $(prefix)/share/ghc/doc/html/base/*.gif $(INSTALL_DIR) + $(INSTALL_DATA) $(prefix)/share/ghc/doc/html/base/*.css $(ROOT) + $(INSTALL_DATA) $(prefix)/share/ghc/doc/html/base/*.js $(ROOT) + $(INSTALL_DATA) $(prefix)/share/ghc/doc/html/base/*.gif $(ROOT) endif # Cabal doesn't let us ask to install docs only, so do nothing here @@ -225,7 +250,7 @@ install-docs: # Thus if you install without building then it will just break. $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \ install.library.%: installPackage/installPackage ifBuildable/ifBuildable - ifBuildable/ifBuildable $* ../installPackage/installPackage + ifBuildable/ifBuildable $* ../installPackage/installPackage $(prefix) $(bindir)/ghc-pkg .PHONY: binary-dist binary-dist.library.%