Install the RTS from a bindist correctly
authorIan Lynagh <igloo@earth.li>
Tue, 5 Jun 2007 13:39:56 +0000 (13:39 +0000)
committerIan Lynagh <igloo@earth.li>
Tue, 5 Jun 2007 13:39:56 +0000 (13:39 +0000)
Makefile
compiler/Makefile
distrib/Makefile
distrib/Makefile-bin-vars.in
distrib/configure-bin.ac
includes/Makefile
mk/package.mk
mk/target.mk
rts/Makefile

index af432d3..dbb4dfe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -59,12 +59,12 @@ include $(TOP)/mk/boilerplate.mk
 
 # We can't 'make boot' in libraries until stage1 is built
 ifeq "$(BootingFromHc)" "YES"
 
 # We can't 'make boot' in libraries until stage1 is built
 ifeq "$(BootingFromHc)" "YES"
-SUBDIRS_NOLIB = includes rts compat compiler docs utils driver
+SUBDIRS_BUILD = includes rts compat compiler docs utils driver
 else
 else
-SUBDIRS_NOLIB = includes compat utils driver docs compiler rts
+SUBDIRS_BUILD = includes compat utils driver docs compiler rts
 endif
 
 endif
 
-SUBDIRS = $(SUBDIRS_NOLIB) libraries
+SUBDIRS_INSTALL = includes compat utils driver docs rts libraries compiler
 
 # Sanity check that all the core libraries are in the tree, to catch
 # failure to run darcs-all.
 
 # Sanity check that all the core libraries are in the tree, to catch
 # failure to run darcs-all.
@@ -85,7 +85,7 @@ check-packages :
 stage1 : check-packages
        $(MAKE) -C utils/mkdependC boot
        @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
 stage1 : check-packages
        $(MAKE) -C utils/mkdependC boot
        @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
-       for i in $(SUBDIRS_NOLIB); do \
+       for i in $(SUBDIRS_BUILD); do \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) boot $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) boot $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
@@ -93,7 +93,7 @@ stage1 : check-packages
          $(MAKE) --no-print-directory -C $$i $(MFLAGS) boot; \
          if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ;  then true; else exit 1; fi; \
        done; \
          $(MAKE) --no-print-directory -C $$i $(MFLAGS) boot; \
          if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ;  then true; else exit 1; fi; \
        done; \
-       for i in $(SUBDIRS_NOLIB); do \
+       for i in $(SUBDIRS_BUILD); do \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) all $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) all $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
@@ -137,7 +137,7 @@ endif
 install :: check-packages
        $(INSTALL_DIR) $(bindir)
        @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
 install :: check-packages
        $(INSTALL_DIR) $(bindir)
        @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
-       for i in $(SUBDIRS); do \
+       for i in $(SUBDIRS_INSTALL); do \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) $@ $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) $@ $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
@@ -179,7 +179,7 @@ endif
 
 install-docs ::
        @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
 
 install-docs ::
        @case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
-       for i in $(SUBDIRS); do \
+       for i in $(SUBDIRS_INSTALL); do \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) $@ $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
          echo "------------------------------------------------------------------------"; \
          echo "== $(MAKE) $@ $(MFLAGS);"; \
          echo " in $(shell pwd)/$$i"; \
@@ -232,9 +232,7 @@ endif
 
 .PHONY: binary-dist-pre% binary-dist binary-pack
 
 
 .PHONY: binary-dist-pre% binary-dist binary-pack
 
-BINARY_DIST_PRE_RULES=$(foreach d,$(BinDistDirs),binary-dist-pre-$d)
-
-binary-dist:: binary-dist-pre $(BINARY_DIST_PRE_RULES)
+binary-dist:: binary-dist-pre
 
 binary-dist-pre::
        -rm -rf $(BIN_DIST_DIR)
 
 binary-dist-pre::
        -rm -rf $(BIN_DIST_DIR)
@@ -244,23 +242,19 @@ binary-dist-pre::
        echo 'include $$(TOP)/mk/install.mk' >  $(BIN_DIST_DIR)/mk/target.mk
        echo 'include $$(TOP)/mk/recurse.mk' >> $(BIN_DIST_DIR)/mk/target.mk
        echo ''                              >  $(BIN_DIST_DIR)/mk/compat.mk
        echo 'include $$(TOP)/mk/install.mk' >  $(BIN_DIST_DIR)/mk/target.mk
        echo 'include $$(TOP)/mk/recurse.mk' >> $(BIN_DIST_DIR)/mk/target.mk
        echo ''                              >  $(BIN_DIST_DIR)/mk/compat.mk
+       cp mk/package.mk $(BIN_DIST_DIR)/mk/
        cp mk/install.mk $(BIN_DIST_DIR)/mk/
        cp mk/recurse.mk $(BIN_DIST_DIR)/mk/
        $(MKDIRHIER) $(BIN_DIST_DIR)/lib/$(TARGETPLATFORM)
        $(MKDIRHIER) $(BIN_DIST_DIR)/share
 
        cp mk/install.mk $(BIN_DIST_DIR)/mk/
        cp mk/recurse.mk $(BIN_DIST_DIR)/mk/
        $(MKDIRHIER) $(BIN_DIST_DIR)/lib/$(TARGETPLATFORM)
        $(MKDIRHIER) $(BIN_DIST_DIR)/share
 
-$(BINARY_DIST_PRE_RULES): binary-dist-pre-%:
-       $(MAKE) -C $* $(MFLAGS) $(INSTALL_STAGE) install \
-               prefix=$(BIN_DIST_DIR) \
-               exec_prefix=$(BIN_DIST_DIR) \
-               bindir=$(BIN_DIST_DIR)/bin/$(TARGETPLATFORM) \
-               libdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
-               libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
-               datadir=$(BIN_DIST_DIR)/share
-
 binary-dist::
 binary-dist::
-       $(MAKE) -C driver binary-dist DOING_BIN_DIST=YES
-       $(MAKE) -C utils  binary-dist DOING_BIN_DIST=YES
+       $(MAKE) -C includes binary-dist DOING_BIN_DIST=YES
+       $(MAKE) -C compiler binary-dist DOING_BIN_DIST=YES $(INSTALL_STAGE)
+       # XXX $(MAKE) -C docs     binary-dist DOING_BIN_DIST=YES
+       $(MAKE) -C rts      binary-dist DOING_BIN_DIST=YES
+       $(MAKE) -C driver   binary-dist DOING_BIN_DIST=YES
+       $(MAKE) -C utils    binary-dist DOING_BIN_DIST=YES
 
 VARFILE=$(BIN_DIST_DIR)/Makefile-vars.in
 
 
 VARFILE=$(BIN_DIST_DIR)/Makefile-vars.in
 
@@ -276,6 +270,8 @@ binary-dist::
        echo "package = ghc"                                         >> $(VARFILE)
        echo "version = $(ProjectVersion)"                           >> $(VARFILE)
        echo "ProjectVersion = $(ProjectVersion)"                    >> $(VARFILE)
        echo "package = ghc"                                         >> $(VARFILE)
        echo "version = $(ProjectVersion)"                           >> $(VARFILE)
        echo "ProjectVersion = $(ProjectVersion)"                    >> $(VARFILE)
+       echo "HaveLibGmp = $(HaveLibGmp)"                            >> $(VARFILE)
+       echo "GhcLibsWithUnix = $(GhcLibsWithUnix)"                  >> $(VARFILE)
        cat distrib/Makefile-bin-vars.in                             >> $(VARFILE)
        @echo "Generating a shippable configure script.."
        $(MV) $(BIN_DIST_DIR)/configure-bin.ac $(BIN_DIST_DIR)/configure.ac
        cat distrib/Makefile-bin-vars.in                             >> $(VARFILE)
        @echo "Generating a shippable configure script.."
        $(MV) $(BIN_DIST_DIR)/configure-bin.ac $(BIN_DIST_DIR)/configure.ac
@@ -354,7 +350,7 @@ endif
 fiddle-binary-dist:
        cd $(BIN_DIST_DIR) && ../distrib/prep-bin-dist-mingw
 # Tar up the distribution and build a manifest
 fiddle-binary-dist:
        cd $(BIN_DIST_DIR) && ../distrib/prep-bin-dist-mingw
 # Tar up the distribution and build a manifest
-binary-dist :: tar-binary-dist
+# XXX binary-dist :: tar-binary-dist
 
 .PHONY: tar-binary-dist
 tar-binary-dist:
 
 .PHONY: tar-binary-dist
 tar-binary-dist:
@@ -427,7 +423,7 @@ SRC_DIST_DIR=$(shell pwd)/$(SRC_DIST_NAME)
 #
 # Files to include in source distributions
 #
 #
 # Files to include in source distributions
 #
-SRC_DIST_DIRS += mk docs distrib $(filter-out docs distrib,$(SUBDIRS))
+SRC_DIST_DIRS += mk docs distrib $(filter-out docs distrib,$(SUBDIRS_INSTALL))
 SRC_DIST_FILES += \
        configure.ac config.guess config.sub configure \
        aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \
 SRC_DIST_FILES += \
        configure.ac config.guess config.sub configure \
        aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \
index 19fba4e..6c53f49 100644 (file)
@@ -894,17 +894,45 @@ else
 GhcLibraryName=libHS$(PACKAGE)$(_way).a
 endif
 
 GhcLibraryName=libHS$(PACKAGE)$(_way).a
 endif
 
+ifneq "$(DOING_BIN_DIST)" "YES"
 $(GHC_PROG) : $(GhcLibraryName) main/Main.hs
        $(RM) package.conf.inplace
        $(RM) $(STAMP_PKG_CONF)
        $(MAKE) $(STAMP_PKG_CONF)
        $(MAKE) -f Makefile.ghcbin $(MFLAGS) HS_PROG=$(GHC_PROG) $@
 $(GHC_PROG) : $(GhcLibraryName) main/Main.hs
        $(RM) package.conf.inplace
        $(RM) $(STAMP_PKG_CONF)
        $(MAKE) $(STAMP_PKG_CONF)
        $(MAKE) -f Makefile.ghcbin $(MFLAGS) HS_PROG=$(GHC_PROG) $@
+endif
 
 # Propagate standard targets to Makefile.ghcbin
 docs runtests $(BOOT_TARGET) TAGS clean distclean mostlyclean maintainer-clean $(INSTALL_TARGET) $(INSTALL_DOCS_TARGET) html chm HxS ps dvi txt::
        $(MAKE) -f Makefile.ghcbin $(MFLAGS) $@
 endif
 
 
 # Propagate standard targets to Makefile.ghcbin
 docs runtests $(BOOT_TARGET) TAGS clean distclean mostlyclean maintainer-clean $(INSTALL_TARGET) $(INSTALL_DOCS_TARGET) html chm HxS ps dvi txt::
        $(MAKE) -f Makefile.ghcbin $(MFLAGS) $@
 endif
 
+include $(TOP)/mk/package.mk
+
+#-----------------------------------------------------------------------------
+# binary-dist
+
+# $(error Q$(INSTALL_PROGS)W)
+foo:
+       echo Q$(INSTALL_PROGS)W$(GHC_PROG)E
+       echo Q$(INSTALL_LIBEXECS)W$(GHC_PROG)E
+
+binary-dist:
+       $(INSTALL_DIR)                         $(BIN_DIST_DIR)/compiler
+       $(INSTALL_DIR)                         $(BIN_DIST_DIR)/compiler/stage$(stage)
+       echo "stage=$(stage)"                > $(BIN_DIST_DIR)/compiler/Makefile
+       cat Makefile                        >> $(BIN_DIST_DIR)/compiler/Makefile
+       $(INSTALL_DATA)    package.conf.in     $(BIN_DIST_DIR)/compiler/
+ifneq "$(INSTALL_LIBS)" ""
+       set -e; for f in $(INSTALL_LIBS); do $(INSTALL_DATA) $$f $(BIN_DIST_DIR)/compiler/$$f; done
+endif
+ifneq "$(INSTALL_PROGS)" ""
+       set -e; for f in $(INSTALL_PROGS); do $(INSTALL_PROGRAM) $$f $(BIN_DIST_DIR)/compiler/$$f; done
+endif
+ifneq "$(INSTALL_LIBEXECS)" ""
+       set -e; for f in $(INSTALL_LIBEXECS); do $(INSTALL_PROGRAM) $$f $(BIN_DIST_DIR)/compiler/$$f; done
+endif
+
 #-----------------------------------------------------------------------------
 #              clean
 
 #-----------------------------------------------------------------------------
 #              clean
 
@@ -930,7 +958,6 @@ EXTRA_SRCS += parser/Parser.y
 
 TAGS_HS_SRCS = parser/Parser.y.pp $(filter-out $(DERIVED_SRCS) main/Config.hs parser/Parser.y, $(sort $(SRCS)))
 
 
 TAGS_HS_SRCS = parser/Parser.y.pp $(filter-out $(DERIVED_SRCS) main/Config.hs parser/Parser.y, $(sort $(SRCS)))
 
-
 include $(TOP)/mk/target.mk
 
 # -----------------------------------------------------------------------------
 include $(TOP)/mk/target.mk
 
 # -----------------------------------------------------------------------------
index 2b6cdca..d60e111 100644 (file)
@@ -12,14 +12,22 @@ in-place ::
        fi
        @echo "Finished configuring..to use, add `pwd`/bin/$(platform) to your PATH."
 
        fi
        @echo "Finished configuring..to use, add `pwd`/bin/$(platform) to your PATH."
 
-install-dirs ::
+install ::
        $(INSTALL_DIR) $(bindir)
        (cd lib/$(platform); find . -type d -exec sh -c '$(INSTALL_DIR) $$0 $(libdir)/$$0' {} \; )
        (cd share; find . -type d -exec sh -c '$(INSTALL_DIR) $(datadir)/$$0' {} \; )
 
        $(INSTALL_DIR) $(bindir)
        (cd lib/$(platform); find . -type d -exec sh -c '$(INSTALL_DIR) $$0 $(libdir)/$$0' {} \; )
        (cd share; find . -type d -exec sh -c '$(INSTALL_DIR) $(datadir)/$$0' {} \; )
 
-install :: install-dirs install-driver install-utils install-libs install-datas install-docs postinstall denounce
+install::
+       $(MAKE) -C includes  install DOING_BIN_DIST=YES
+       $(MAKE) -C driver    install DOING_BIN_DIST=YES
+       $(MAKE) -C utils     install DOING_BIN_DIST=YES
+       $(MAKE) -C rts       install DOING_BIN_DIST=YES
+       $(MAKE) -C libraries install DOING_BIN_DIST=YES
+       $(MAKE) -C compiler  install DOING_BIN_DIST=YES
+
+install :: install-docs postinstall denounce
 
 
-.PHONY: install-libs install-utils install-datas postinstall denounce
+.PHONY: postinstall denounce
 
 denounce:
        @echo
 
 denounce:
        @echo
@@ -44,21 +52,6 @@ postinstall:
                echo "Done" ; \
        fi
 
                echo "Done" ; \
        fi
 
-install-libs:
-       (cd lib/$(platform); find . -type f -exec sh -c '$(CP) $$0 $(libdir)/$$0' {} \; )
-       $(MAKE) -C libraries install DOING_BIN_DIST=YES
-
-install-driver:
-       $(MAKE) -C driver install DOING_BIN_DIST=YES
-
-install-utils:
-       $(MAKE) -C utils install DOING_BIN_DIST=YES
-
-install-datas:
-       set -e; for i in `(cd share; find . -type f )`; do \
-          $(INSTALL_DATA) share/$$i $(datadir)/$$i; \
-       done
-
 show-install-setup:
        @echo "Install setup..."
        @echo "bindir  = $(bindir)"
 show-install-setup:
        @echo "Install setup..."
        @echo "bindir  = $(bindir)"
index 0a4fdb9..5a54cbf 100644 (file)
@@ -27,8 +27,11 @@ LN_S        = @LN_S@
 CHMOD       = chmod
 INSTALL            = @INSTALL@
 exeext      = @exeext@
 CHMOD       = chmod
 INSTALL            = @INSTALL@
 exeext      = @exeext@
-SED        = @SedCmd@
+SED            = @SedCmd@
 DEFAULT_TMPDIR = /tmp
 DEFAULT_TMPDIR = /tmp
+RANLIB      = @RANLIB@
+
+RAWCPP_FLAGS            = -undef -traditional
 
 #----------end of user-serviceable parts------------
 #
 
 #----------end of user-serviceable parts------------
 #
index fd8c2f1..0d01388 100644 (file)
@@ -132,6 +132,11 @@ dnl ** how to do symlinks **
 AC_PROG_LN_S()
 
 #
 AC_PROG_LN_S()
 
 #
+dnl ** how to invoke `ar' and `ranlib'
+#
+FP_PROG_AR_NEEDS_RANLIB
+
+#
 dnl ** Find the path to sed **
 #
 AC_PATH_PROG(SedCmd,sed)
 dnl ** Find the path to sed **
 #
 AC_PATH_PROG(SedCmd,sed)
index cfb2a48..4b89d52 100644 (file)
@@ -4,9 +4,17 @@ TOP = ..
 include $(TOP)/mk/boilerplate.mk
 
 #
 include $(TOP)/mk/boilerplate.mk
 
 #
+# Header files built from the configure script's findings
+#
+H_CONFIG   = ghcautoconf.h
+H_PLATFORM = ghcplatform.h
+
+#
 # All header files
 #
 # All header files
 #
-H_FILES = $(filter-out gmp.h,$(wildcard *.h)) gmp.h
+H_FILES = $(filter-out gmp.h $(H_CONFIG) $(H_PLATFORM),$(wildcard *.h)) gmp.h
+
+ifneq "$(DOING_BIN_DIST)" "YES"
 
 #
 # Options
 
 #
 # Options
@@ -25,12 +33,6 @@ ifneq "$(GhcWithSMP)" "YES"
 SRC_CC_OPTS += -DNOSMP
 endif
 
 SRC_CC_OPTS += -DNOSMP
 endif
 
-#
-# Header file built from the configure script's findings
-#
-H_CONFIG   = ghcautoconf.h
-H_PLATFORM = ghcplatform.h
-
 boot :: gmp.h
 
 all :: $(H_CONFIG) $(H_PLATFORM)
 boot :: gmp.h
 
 all :: $(H_CONFIG) $(H_PLATFORM)
@@ -160,6 +162,8 @@ endif
 
 CLEAN_FILES += mkGHCConstants$(exeext) GHCConstants.h
 
 
 CLEAN_FILES += mkGHCConstants$(exeext) GHCConstants.h
 
+endif
+
 # ---------------------------------------------------------------------------
 # boot setup:
 #
 # ---------------------------------------------------------------------------
 # boot setup:
 #
@@ -175,6 +179,11 @@ CLEAN_FILES += mkGHCConstants$(exeext) GHCConstants.h
 override datadir:=$(libdir)/include
 INSTALL_DATAS += $(H_FILES) $(H_CONFIG) $(H_PLATFORM)
 
 override datadir:=$(libdir)/include
 INSTALL_DATAS += $(H_FILES) $(H_CONFIG) $(H_PLATFORM)
 
+binary-dist:
+       $(INSTALL_DIR)                   $(BIN_DIST_DIR)/includes
+       $(INSTALL_DATA) Makefile         $(BIN_DIST_DIR)/includes/
+       $(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/includes/
+
 #
 # `make clean' settings:
 #
 #
 # `make clean' settings:
 #
index 6c22535..00e3ea2 100644 (file)
@@ -10,9 +10,7 @@ ifneq "$(PACKAGE)" ""
 # to the compiler, and spliced into package.conf in place of $topdir at
 # runtime.
 #
 # to the compiler, and spliced into package.conf in place of $topdir at
 # runtime.
 #
-# On Unix, we only use absolute paths in package.conf, except that when
-# building a binary distribution we use $libdir and $datadir in package.conf
-# which are then replaced by the correct values at install time.
+# On Unix, we only use absolute paths in package.conf.
 #
 
 ifeq "$(Windows)" "YES"
 #
 
 ifeq "$(Windows)" "YES"
@@ -22,8 +20,8 @@ PKG_DATADIR = $$topdir
 
 else
 
 
 else
 
-PKG_LIBDIR  = $$libdir
-PKG_DATADIR = $$datadir
+PKG_LIBDIR  = $(libdir)
+PKG_DATADIR = $(datadir)
 
 endif # Unix
 
 
 endif # Unix
 
@@ -74,17 +72,19 @@ package.conf.inplace   : package.conf.in
        grep -v '^#pragma GCC' | \
        sed -e 's/""//g' -e 's/:[       ]*,/: /g' >$@
 
        grep -v '^#pragma GCC' | \
        sed -e 's/""//g' -e 's/:[       ]*,/: /g' >$@
 
-package.conf.installed : package.conf.in
+install::
        $(CPP) $(RAWCPP_FLAGS) -P -DINSTALLING \
        $(CPP) $(RAWCPP_FLAGS) -P -DINSTALLING \
-               -DIMPORT_DIR='"$(IMPORT_DIR_INSTALLED)"' \
-               -DLIB_DIR='"$(LIB_DIR_INSTALLED)"' \
-               -DINCLUDE_DIR='"$(INCLUDE_DIR_INSTALLED)"' \
-               -DDATA_DIR='"$(DATA_DIR_INSTALLED)"' \
-               -DHTML_DIR='"$(HTML_DIR_INSTALLED)"' \
-               -DHADDOCK_IFACE='"$(HADDOCK_IFACE_INSTALLED)"' \
-                -x c $(PACKAGE_CPP_OPTS) $< | \
-       grep -v '^#pragma GCC' | \
-       sed -e 's/""//g' -e 's/:[       ]*,/: /g' >$@
+              -DIMPORT_DIR='"$(IMPORT_DIR_INSTALLED)"' \
+              -DLIB_DIR='"$(LIB_DIR_INSTALLED)"' \
+              -DINCLUDE_DIR='"$(INCLUDE_DIR_INSTALLED)"' \
+              -DDATA_DIR='"$(DATA_DIR_INSTALLED)"' \
+              -DHTML_DIR='"$(HTML_DIR_INSTALLED)"' \
+              -DHADDOCK_IFACE='"$(HADDOCK_IFACE_INSTALLED)"' \
+              -I../includes \
+              -x c $(PACKAGE_CPP_OPTS) package.conf.in \
+           | grep -v '^#pragma GCC' \
+           | sed -e 's/""//g' -e 's/:[   ]*,/: /g' \
+           | $(bindir)/ghc-pkg update - --force
 
 # we could be more accurate here and add a dependency on
 # driver/package.conf, but that doesn't work too well because of
 
 # we could be more accurate here and add a dependency on
 # driver/package.conf, but that doesn't work too well because of
@@ -105,12 +105,11 @@ ifneq "$(BootingFromHc)" "YES"
 boot all :: $(STAMP_PKG_CONF)
 endif
 
 boot all :: $(STAMP_PKG_CONF)
 endif
 
-$(STAMP_PKG_CONF) : package.conf.inplace package.conf.installed
+$(STAMP_PKG_CONF) : package.conf.inplace
        $(GHC_PKG_INPLACE) update - --force-files <package.conf.inplace
        $(GHC_PKG_INPLACE) update - --force-files <package.conf.inplace
-       $(GHC_PKG_INPLACE) update - -f $(GHC_DRIVER_DIR)/package.conf --force-files <package.conf.installed
        @touch $(STAMP_PKG_CONF)
 
        @touch $(STAMP_PKG_CONF)
 
-CLEAN_FILES += package.conf.installed package.conf.inplace 
+CLEAN_FILES += package.conf.inplace 
 
 endif # $(way) == ""
 
 
 endif # $(way) == ""
 
@@ -231,10 +230,6 @@ ifndef GHCI_LIBRARY
 GHCI_LIBRARY = $(patsubst lib%.a,%.o,$(LIBRARY))
 endif
 
 GHCI_LIBRARY = $(patsubst lib%.a,%.o,$(LIBRARY))
 endif
 
-ifneq "$(NO_INSTALL_LIBRARY)" "YES"
-INSTALL_LIBS += $(GHCI_LIBRARY)
-endif
-
 CLEAN_FILES  += $(GHCI_LIBRARY)
 
 all :: $(GHCI_LIBRARY)
 CLEAN_FILES  += $(GHCI_LIBRARY)
 
 all :: $(GHCI_LIBRARY)
index 513b0dc..8a9e5b5 100644 (file)
 
 PRE_SRCS := $(ALL_SRCS)
 
 
 PRE_SRCS := $(ALL_SRCS)
 
-##################################################################
-# Include package building machinery
-
-include $(TOP)/mk/package.mk
-
 ###################################################################
 # Suffix rules for Haskell, C and literate 
 
 ###################################################################
 # Suffix rules for Haskell, C and literate 
 
index 184a844..1eebfd6 100644 (file)
@@ -383,17 +383,33 @@ ifneq "$(BootingFromHc)" "YES"
        $(HC) $(HC_OPTS) -S $< -o $@
 endif
 
        $(HC) $(HC_OPTS) -S $< -o $@
 endif
 
+include $(TOP)/mk/package.mk
+
 #-----------------------------------------------------------------------------
 #
 # Files to install
 #
 # Just libHSrts is installed uniformly across ways
 #
 #-----------------------------------------------------------------------------
 #
 # Files to install
 #
 # Just libHSrts is installed uniformly across ways
 #
-INSTALL_LIBS += $(LIBRARY)
 ifeq "$(DLLized)" "YES"
 ifeq "$(DLLized)" "YES"
-INSTALL_PROGS += $(DLL_NAME) gmp/gmp.dll
-INSTALL_LIBS += $(patsubst %.a,%_imp.a,$(LIBARY))
+INSTALL_PROGS += gmp/gmp.dll
 INSTALL_LIBS += gmp/libgmp_imp.a Main.dll_o
 endif
 
 INSTALL_LIBS += gmp/libgmp_imp.a Main.dll_o
 endif
 
+#-----------------------------------------------------------------------------
+#
+# binary-dist
+
+binary-dist:
+       $(INSTALL_DIR)                         $(BIN_DIST_DIR)/rts
+       $(INSTALL_DIR)                         $(BIN_DIST_DIR)/rts/gmp
+       $(INSTALL_DATA)    Makefile            $(BIN_DIST_DIR)/rts/
+       $(INSTALL_DATA)    package.conf.in     $(BIN_DIST_DIR)/rts/
+ifneq "$(INSTALL_LIBS)" ""
+       $(INSTALL_DATA)    $(INSTALL_LIBS)     $(BIN_DIST_DIR)/rts/
+endif
+ifneq "$(INSTALL_LIBEXECS)" ""
+       $(INSTALL_PROGRAM) $(INSTALL_LIBEXECS) $(BIN_DIST_DIR)/rts/
+endif
+
 include $(TOP)/mk/target.mk
 include $(TOP)/mk/target.mk