Change references to the old BIN_DIST_TARBALL to the new BIN_DIST_TAR_BZ2
[ghc-hetmet.git] / Makefile
index 1f9b653..3bd6b72 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -88,7 +88,7 @@ endif
 # Sanity check that all the boot libraries are in the tree, to catch
 # failure to run darcs-all.
 check-packages :
-       @ds=`grep "^[^# ][^ ]*  *[^ ][^ ]*$$" packages | sed "s/ .*//"`;\
+       @ds=`grep "^[^# ][^ ]*  *[^ ][^ ]*  *[^ ][^ ]*$$" packages | sed "s/ .*//"`;\
        for d in $$ds; do \
          if test ! -d $$d; then \
             echo "Looks like you're missing $$d,"; \
@@ -131,8 +131,6 @@ stage1 : $(GCC_LIB_DEP) check-all
          $(MAKE) --no-print-directory -C $$i $(MFLAGS) all; \
          if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ;  then true; else exit 1; fi; \
        done
-       $(MAKE) -C ghc stage=1 boot
-       $(MAKE) -C ghc stage=1
        $(MAKE) -C rts boot
        $(MAKE) -C rts
        $(MAKE) -C libraries all
@@ -151,14 +149,10 @@ stage2 : check-all
 ifeq "$(HADDOCK_DOCS)" "YES"
        $(MAKE) -C compiler stage=2 doc
 endif
-       $(MAKE) -C ghc      stage=2 boot
-       $(MAKE) -C ghc      stage=2
 
 stage3 : check-all
        $(MAKE) -C compiler stage=3 boot
        $(MAKE) -C compiler stage=3
-       $(MAKE) -C ghc      stage=3 boot
-       $(MAKE) -C ghc      stage=3
 
 bootstrap  : bootstrap2
 
@@ -290,7 +284,7 @@ install-docs ::
 
 binary-dist::
        -rm -rf $(BIN_DIST_DIR)
-       -$(RM) $(BIN_DIST_TARBALL)
+       -$(RM) $(BIN_DIST_TAR_BZ2)
 
 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
 
@@ -305,6 +299,14 @@ binary-dist::
        $(MKDIRHIER) $(BIN_DIST_DIR)/icons
        cp distrib/hsicon.ico $(BIN_DIST_DIR)/icons
 
+# Tar up the distribution and build a manifest
+binary-dist :: tar-binary-dist
+
+.PHONY: tar-binary-dist
+tar-binary-dist:
+       ( cd $(BIN_DIST_TOPDIR_ABS); tar cf - $(BIN_DIST_NAME) | bzip2 > $(BIN_DIST_TAR_BZ2) )
+       ( cd $(BIN_DIST_TOPDIR_ABS); bunzip2 -c $(BIN_DIST_TAR_BZ2) | tar tf - | sed "s/^ghc-$(ProjectVersion)/fptools/" | sort >$(FPTOOLS_TOP_ABS)/bin-manifest-$(ProjectVersion) )
+
 else
 
 .PHONY: binary-dist
@@ -337,6 +339,7 @@ binary-dist::
        $(MAKE) -C gmp                 binary-dist WHERE_AM_I=$(WHERE_AM_I)/gmp
        $(MAKE) -C includes            binary-dist WHERE_AM_I=$(WHERE_AM_I)/includes
        $(MAKE) -C compiler            binary-dist WHERE_AM_I=$(WHERE_AM_I)/compiler $(INSTALL_STAGE)
+       $(MAKE) -C ghc                 binary-dist WHERE_AM_I=$(WHERE_AM_I)/ghc      $(INSTALL_STAGE)
        $(MAKE) -C rts                 binary-dist WHERE_AM_I=$(WHERE_AM_I)/rts
        $(MAKE) -C driver              binary-dist WHERE_AM_I=$(WHERE_AM_I)/driver
        $(MAKE) -C utils               binary-dist WHERE_AM_I=$(WHERE_AM_I)/utils
@@ -346,8 +349,6 @@ binary-dist::
 # Now thinks get messier. Some files we need to move around, rename or
 # generate. We do this under $(BIN_DIST_PREP).
        $(RM) -rf    $(BIN_DIST_PREP_DIR)
-       $(MKDIRHIER) $(BIN_DIST_PREP)/utils/pwd
-       cp utils/pwd/dist-install/build/pwd/pwd $(BIN_DIST_PREP)/utils/pwd
        $(MKDIRHIER) $(BIN_DIST_PREP)/mk
        echo 'include $$(TOP)/Makefile-vars' >  $(BIN_DIST_PREP)/mk/boilerplate.mk
        echo 'include $$(TOP)/mk/package.mk' >  $(BIN_DIST_PREP)/mk/target.mk
@@ -366,6 +367,15 @@ endif
 # next to configure.ac when we run autoreconf
        cp aclocal.m4               $(BIN_DIST_PREP)
        cd $(BIN_DIST_PREP) && autoreconf
+# We need to copy the pwd program that was built with stage1 to where
+# the build system expects to find it, i.e. the location the pwd built
+# with the bootstrapping compiler normally occupies
+       $(MKDIRHIER) $(BIN_DIST_PREP)/utils/pwd
+       cp utils/pwd/dist-install/build/pwd/pwd $(BIN_DIST_PREP)/utils/pwd
+# And likewise the installPackage program
+       $(MKDIRHIER) $(BIN_DIST_PREP)/utils/installPackage/install-inplace/bin
+       cp utils/installPackage/dist-install/build/installPackage/installPackage \
+          $(BIN_DIST_PREP)/utils/installPackage/install-inplace/bin
 
        echo "package = ghc"                              >> $(BIN_DIST_VARFILE)
        echo "version = $(ProjectVersion)"                >> $(BIN_DIST_VARFILE)
@@ -380,28 +390,22 @@ endif
        echo "XSLTPROC = $(XSLTPROC)"                     >> $(BIN_DIST_VARFILE)
        echo "TARGETPLATFORM = $(TARGETPLATFORM)"         >> $(BIN_DIST_VARFILE)
        echo "HADDOCK_DOCS = $(HADDOCK_DOCS)"             >> $(BIN_DIST_VARFILE)
+       echo "INTEGER_LIBRARY = $(INTEGER_LIBRARY)"       >> $(BIN_DIST_VARFILE)
        cat distrib/Makefile-bin-vars.in                  >> $(BIN_DIST_VARFILE)
 
 # With that done, we can now build the actual tarball
 
        $(RM) -f $(BIN_DIST_NAME)
        ln -s . $(BIN_DIST_NAME)
-       tar cf $(BIN_DIST_TAR) -T $(BIN_DIST_LIST)
+# h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
+# tree then we want to include the real file, not a symlink to it
+       tar hcf $(BIN_DIST_TAR) -T $(BIN_DIST_LIST)
        cd $(BIN_DIST_PREP_DIR) && tar rf $(BIN_DIST_TAR) $(BIN_DIST_NAME)
        bzip2 < $(BIN_DIST_TAR) > $(BIN_DIST_TAR_BZ2)
        tar tf $(BIN_DIST_TAR) | sort > bin-manifest-$(ProjectVersion)
 endif
 
-# XXX Presumably we still need to do this for Windows?
-## Tar up the distribution and build a manifest
-#binary-dist :: tar-binary-dist
-#
-#.PHONY: tar-binary-dist
-#tar-binary-dist:
-#      ( cd $(BIN_DIST_TOPDIR_ABS); tar cf - $(BIN_DIST_NAME) | bzip2 >$(BIN_DIST_TARBALL) )
-#      ( cd $(BIN_DIST_TOPDIR_ABS); bunzip2 -c $(BIN_DIST_TARBALL) | tar tf - | sed "s/^ghc-$(ProjectVersion)/fptools/" | sort >$(FPTOOLS_TOP_ABS)/bin-manifest-$(ProjectVersion) )
-
-PUBLISH_FILES = $(BIN_DIST_TARBALL)
+PUBLISH_FILES = $(BIN_DIST_TAR_BZ2)
 
 # Upload the distribution and documentation
 ifneq "$(ISCC)" ""
@@ -592,7 +596,7 @@ DIST_CLEAN_FILES += config.cache config.status mk/config.h mk/stamp-h \
        docs/users_guide/ug-book.xml extra-gcc-opts
 
 # don't clean config.mk: it's needed when cleaning stuff later on
-LATE_DIST_CLEAN_FILES += mk/config.mk 
+LATE_DIST_CLEAN_FILES += mk/config.mk mk/are-validating.mk
 
 # VERSION is shipped in a source dist
 MAINTAINER_CLEAN_FILES += VERSION
@@ -601,6 +605,9 @@ extraclean::
        $(RM) -rf autom4te.cache
 
 clean distclean ::
+       $(RM) -rf inplace-datadir
+
+clean distclean ::
        $(MAKE) -C bindisttest $@
        if test -d testsuite; then $(MAKE) -C testsuite $@; fi