+ $(RM) -rf stage1 stage2plus
+ $(RM) -f $(STAGE3_PACKAGE_CONF)
+endif
+
+ifeq "$(CLEAN_ALL_STAGES)" "YES"
+clean distclean maintainer-clean:: clean.stage.1 clean.stage.2 clean.stage.3
+else
+clean distclean maintainer-clean:: clean.stage.$(stage)
+endif
+
+ifeq "$(CLEAN_ALL_STAGES)" "YES"
+distclean maintainer-clean::
+ $(RM) -f ghc.cabal
+endif
+
+clean.stage.%:
+ $(RM) -f Makefile-stage$*
+# This is a bit naughty. We ought to use:
+# -$(CABAL) clean --distpref dist-stage$*
+# but that won't work if the Cabal file (a generated file) doesn't
+# exist. So we do this instead:
+ $(RM) -rf dist-stage$*
+
+CONFIGURE_FLAGS_STAGE1 += --flags=stage1
+CONFIGURE_FLAGS_STAGE2 += --flags=-stage1
+
+ifeq "$(GhcWithNativeCodeGen)" "YES"
+CONFIGURE_FLAGS_STAGE1 += --flags=ncg
+CONFIGURE_FLAGS_STAGE2 += --flags=ncg
+endif