-install.library.%: stamp/configure.library.install.% %/setup/Setup
- ifBuildable/ifBuildable $* setup/Setup install
-
-.PHONY: distclean clean clean.library.%
-
-distclean: clean
-
-clean: $(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR))
- $(RM) -f stamp/$(BOOTSTRAPPING_CABAL)
- $(RM) -rf $(BOOTSTRAPPING_CABAL)
- $(RM) -rf ifBuildable
- $(RM) -f libraries.txt index.html doc-index.html
-
-$(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)): \
-clean.library.%:
- $(RM) -f stamp/configure.library.*.$* $*/unbuildable
- -cd $* && setup/Setup clean
- $(RM) -rf $*/setup
+install.library.%: installPackage/installPackage ifBuildable/ifBuildable
+ ifBuildable/ifBuildable $* ../installPackage/installPackage $(prefix) $(bindir)/ghc-pkg
+
+.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)/$*
+ ifBuildable/ifBuildable $* cp $*.cabal $(BIN_DIST_LIBDIR)/$*
+ ifBuildable/ifBuildable $* cp -a dist $(BIN_DIST_LIBDIR)/$*
+ # Euch
+ ifBuildable/ifBuildable $* cp -aL include $(BIN_DIST_LIBDIR)/$* || :
+ ifBuildable/ifBuildable $* $(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
+ \( -name "*_split" -o -name "autogen" \) | xargs rm -rf
+ ifBuildable/ifBuildable $* $(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
+ \( \( -name "*.o" -o -name "*.p_o" \) -a ! -name "HS*" \) \
+ -exec rm {} \;