Add instructions for adding a library to a build tree
[ghc-hetmet.git] / libraries / Makefile
index a76739e..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
 
@@ -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))