<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>boot-pkgs</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -43,13 +43,19 @@ endif
 
 include mk/custom-settings.mk
 
+# If the package ghc.mk files are missing, generate them.  This means that
+# repeating 'make maintainer-clean' works.
+PACKAGE_MK=libraries/base/ghc.mk
+$(PACKAGE_MK):
+	sh boot-pkgs
+
 # No need to update makefiles for these targets:
 REALGOALS=$(filter-out framework-pkg clean clean_% distclean maintainer-clean show,$(MAKECMDGOALS))
 
 # NB. not the same as saying '%: ...', which doesn't do the right thing:
 # it does nothing if we specify a target that already exists.
 .PHONY: $(REALGOALS)
-$(REALGOALS) all:
+$(REALGOALS) all: $(PACKAGE_MK)
 	@echo &quot;===--- updating makefiles phase 0&quot;
 	$(MAKE) -r --no-print-directory -f ghc.mk phase=0 just-makefiles
 	@echo &quot;===--- updating makefiles phase 1&quot;
@@ -61,19 +67,19 @@ $(REALGOALS) all:
 	@echo &quot;===--- finished updating makefiles&quot;
 	$(MAKE) -r --no-print-directory -f ghc.mk $@
 
-binary-dist:
+binary-dist: $(PACKAGE_MK)
 	rm -f bindist-list
 	$(MAKE) -r --no-print-directory -f ghc.mk bindist BINDIST=YES
 	$(MAKE) -r --no-print-directory -f ghc.mk binary-dist
 
-clean distclean maintainer-clean:
+clean distclean maintainer-clean: $(PACKAGE_MK)
 	$(MAKE) -r --no-print-directory -f ghc.mk $@
 	test ! -d testsuite || $(MAKE) -C testsuite $@
 
-$(filter clean_%, $(MAKECMDGOALS)) : clean_% :
+$(filter clean_%, $(MAKECMDGOALS)) : clean_% : $(PACKAGE_MK)
 	$(MAKE) -r --no-print-directory -f ghc.mk $@
 
-show:
+show: $(PACKAGE_MK)
 	$(MAKE) -r --no-print-directory -f ghc.mk $@
 
 ifeq &quot;$(darwin_TARGET_OS)&quot; &quot;1&quot;
@@ -86,4 +92,3 @@ endif
 .NOTPARALLEL:
 
 endif
-</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -30,40 +30,3 @@ do
         chmod +x $f
     fi
 done
-
-libraries=
-
-for f in libraries/*; do
-  pkgs=$f/ghc-packages
-  if test -f $pkgs; then
-    for p in `cat $pkgs`; do
-      libraries=&quot;$libraries $f/$p&quot;
-    done
-  else
-    libraries=&quot;$libraries $f&quot;
-  fi
-done
-
-for f in $libraries; do
-   dir=`basename $f`
-   cabals=`echo $f/*.cabal`
-   if test -f $cabals; then
-       echo &quot;Creating $f/ghc.mk&quot;
-       rm -f $f/ghc.mk
-       pkg=`echo &quot;$cabals&quot; | sed -e 's#.*/##' -e 's#\.cabal$##'`
-       if test -f $f/ghc-stage; then
-           stage=`cat $f/ghc-stage`
-       else
-           stage=1
-       fi
-       top=`echo $f | sed 's#[^/]\+#..#g'`
-       echo &quot;${f}_PACKAGE = ${pkg}&quot; &gt;&gt; $f/ghc.mk
-       echo &quot;${f}_dist-install_GROUP = libraries&quot; &gt;&gt; $f/ghc.mk
-       echo &quot;\$(eval \$(call build-package,${f},dist-install,${stage}))&quot; &gt;&gt; $f/ghc.mk
-       rm -f $f/GNUmakefile
-       echo &quot;Creating $f/GNUmakefile&quot;
-       echo &quot;dir = ${f}&quot; &gt;&gt; $f/GNUmakefile
-       echo &quot;TOP = ${top}&quot; &gt;&gt; $f/GNUmakefile
-       echo &quot;include \$(TOP)/mk/sub-makefile.mk&quot; &gt;&gt; $f/GNUmakefile
-   fi
-done</diff>
      <filename>boot</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cfbfe470d29de6ef04d718abea8e9b65ead9cbd4</id>
    </parent>
  </parents>
  <author>
    <name>Simon Marlow</name>
    <email>marlowsd@gmail.com</email>
  </author>
  <url>http://github.com/ghc-hq/ghc/commit/038f4f070fa2d1d1b397f3c225cd91517b21a6df</url>
  <id>038f4f070fa2d1d1b397f3c225cd91517b21a6df</id>
  <committed-date>2009-05-14T03:57:04-07:00</committed-date>
  <authored-date>2009-05-14T03:57:04-07:00</authored-date>
  <message>main repeated 'make maintainer-clean' not fail</message>
  <tree>fb8d0576a3220ee69500e699094c3e6da0b771f4</tree>
  <committer>
    <name>Simon Marlow</name>
    <email>marlowsd@gmail.com</email>
  </committer>
</commit>
