Add instructions for adding a library to a build tree
[ghc-hetmet.git] / libraries / Makefile
index 7d4c067..5302c60 100644 (file)
 # or the following is equivalent:
 #
 #   make rebuild.library.<package>
+#
+# 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
 
@@ -27,7 +33,7 @@ TOP=.
 include $(TOP)/mk/boilerplate.mk
 endif
 
-SUBDIRS = base old-locale old-time directory filepath pretty \
+SUBDIRS = base old-locale old-time directory process filepath pretty \
           template-haskell readline Cabal random haskell98
 
 ifeq "$(GhcLibsWithUnix)" "YES"
@@ -200,6 +206,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))