+# Cabal doesn't let us ask to install docs only, so do nothing here
+install-docs:
+ @:
+
+# Ideally this would depend on a stamp/build.library.%, but if it does
+# then we can't change the libraries and then just rerun make.
+# Thus if you install without building then it will just break.
+$(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
+install.library.%: installPackage/installPackage ifBuildable/ifBuildable
+ if ifBuildable/ifBuildable $*; then \
+ cd $* && \
+ ../installPackage/installPackage $(prefix) $(bindir)/ghc-pkg; \
+ fi
+
+.PHONY: binary-dist binary-dist.library.%
+
+BIN_DIST_LIBDIR=$(BIN_DIST_DIR)/libraries
+
+binary-dist: $(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR))
+ mkdir $(BIN_DIST_LIBDIR)/installPackage
+ cp installPackage/installPackage $(BIN_DIST_LIBDIR)/installPackage
+ mkdir $(BIN_DIST_LIBDIR)/ifBuildable
+ cp ifBuildable/ifBuildable $(BIN_DIST_LIBDIR)/ifBuildable
+ cp Makefile $(BIN_DIST_LIBDIR)
+ cp gen_contents_index $(BIN_DIST_LIBDIR)
+ cp index.html $(BIN_DIST_LIBDIR)
+ cp doc-index.html $(BIN_DIST_LIBDIR)
+ cp -a stamp $(BIN_DIST_LIBDIR)
+
+$(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR)): \
+binary-dist.library.%:
+ $(MKDIRHIER) $(BIN_DIST_LIBDIR)/$*
+ if ifBuildable/ifBuildable $*; then \
+ cd $* && \
+ cp $*.cabal $(BIN_DIST_LIBDIR)/$* && \
+ cp -a dist $(BIN_DIST_LIBDIR)/$* && \
+ # Euch \
+ (cp -aL include $(BIN_DIST_LIBDIR)/$* || :) && \
+ $(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
+ \( -name "*_split" -o -name "autogen" \) | xargs rm -rf && \
+ $(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
+ \( \( -name "*.o" -o -name "*.p_o" \) -a ! -name "HS*" \) \
+ -exec rm {} \; ; \
+ fi