+.PHONY: maintainer-clean distclean clean clean.library.%
+
+maintainer-clean: clean
+distclean: clean
+
+ifeq "$(wildcard dph)" ""
+clean: $(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR))
+else
+clean: $(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)) clean.library.dph
+endif
+ -cd extensible-exceptions && $(CABAL) clean --distpref=dist-bootstrapping
+ -cd filepath && $(CABAL) clean --distpref=dist-bootstrapping
+ -cd Cabal && $(CABAL) clean --distpref=dist-bootstrapping
+ -cd hpc && $(CABAL) clean --distpref=dist-bootstrapping
+ $(RM) -rf bootstrapping
+ $(RM) -f bootstrapping.conf bootstrapping.conf.old
+ $(RM) -f bootstrapping.conf.tmp bootstrapping.conf.tmp.old
+ $(RM) -f cabal-bin cabal-bin.exe
+ $(RM) -rf ifBuildable
+ $(RM) -f libraries.txt index.html doc-index.html doc-index*.html
+ $(RM) -f haddock* *.gif
+ $(RM) -rf stamp/*
+
+maintainer-clean distclean:
+ $(RM) $(foreach lib, $(SUBDIRS), $(lib)/.depend $(lib)/.depend.bak)
+
+$(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)): \
+clean.library.%:
+ $(RM) -f stamp/configure.library.*.$* $*/unbuildable
+ -cd $* && $(CABAL) clean
+ $(RM) -f $*/Setup $*/Setup.exe $*/Setup.hi $*/Setup.o
+ $(RM) $*/GNUmakefile $*/Makefile.local
+endif