summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2007-09-05 16:06:41 +0000
committerIan Lynagh <igloo@earth.li>2007-09-05 16:06:41 +0000
commitcafb1e0f6bb93fb720e3bb3432c777cd9736bf80 (patch)
tree40b90c1977d9c5d7f8ab4a269b6ac11f96946d03
parent25f84fa7e4b84c3db5ba745a7881c009b778e0b1 (diff)
downloadhaskell-cafb1e0f6bb93fb720e3bb3432c777cd9736bf80.tar.gz
Fix up bindist creation and publishing
-rw-r--r--Makefile19
-rw-r--r--bindisttest/Makefile10
-rw-r--r--distrib/Makefile-bin-vars.in21
-rw-r--r--libraries/Makefile4
-rw-r--r--mk/config.mk.in15
-rw-r--r--mk/package.mk2
6 files changed, 44 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index 445b008d87..61b49e6182 100644
--- a/Makefile
+++ b/Makefile
@@ -394,8 +394,8 @@ binary-dist :: tar-binary-dist
.PHONY: tar-binary-dist
tar-binary-dist:
- ( cd $(BIN_DIST_TOPDIR); tar cf - $(BIN_DIST_NAME) | bzip2 >$(BIN_DIST_TARBALL) )
- ( cd $(BIN_DIST_TOPDIR); bunzip2 -c $(BIN_DIST_TARBALL) | tar tf - | sed "s/^ghc-$(ProjectVersion)/fptools/" | sort >bin-manifest-$(ProjectVersion) )
+ ( 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 >bin-manifest-$(ProjectVersion) )
PUBLISH_FILES = $(BIN_DIST_TARBALL)
@@ -415,7 +415,7 @@ endif
# Upload the distribution and documentation
ifneq "$(PublishLocation)" ""
-binary-dist :: publish-binary-dist
+publish :: publish-binary-dist
endif
.PHONY: publish-binary-dist
@@ -427,16 +427,11 @@ publish-binary-dist ::
done \
done
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-# On Windows, we cannot use absoluate pathnames to rsync, because they look
-# like remote pathnames ("c:/foo/bar"). Also, the docs reside in doc/
-# rather than share/, due to prep-bin-dist-mingw.
-publish-binary-dist ::
- $(PublishCp) -r $(FPTOOLS_TOP)/$(BIN_DIST_NAME)/doc/html/* $(PublishLocation)/docs
-else
+# You need to first make binddisttest, and then run
+# make publish 'prefix=$(BIN_DIST_INST_DIR)'
+# for this to find the right place.
publish-binary-dist ::
- $(PublishCp) -r $(BIN_DIST_DIR)/share/html/* $(PublishLocation)/docs
-endif
+ $(PublishCp) -r $(docdir)/* $(PublishLocation)/docs
binary-dist::
@echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"
diff --git a/bindisttest/Makefile b/bindisttest/Makefile
index cfcf13ba0e..c26ca79f68 100644
--- a/bindisttest/Makefile
+++ b/bindisttest/Makefile
@@ -8,20 +8,18 @@ default_target: all
TOP=..
include $(TOP)/mk/boilerplate.mk
-INST_DIR = $(FPTOOLS_TOP_ABS)/bindisttest/installed
-
all:
$(RM) -rf installed
$(RM) -rf ghc*
$(RM) HelloWorld HelloWorld.o HelloWorld.hi output
- $(TAR) -jxf ../$(BIN_DIST_TARBALL)
+ $(TAR) -jxf $(BIN_DIST_TARBALL)
ifeq "$(Windows)" "YES"
- mv $(BIN_DIST_NAME) $(INST_DIR)
+ mv $(BIN_DIST_NAME) $(BIN_DIST_INST_DIR)
else
- cd $(BIN_DIST_NAME) && ./configure --prefix=$(INST_DIR)
+ cd $(BIN_DIST_NAME) && ./configure --prefix=$(BIN_DIST_INST_DIR)
cd $(BIN_DIST_NAME) && make install
endif
- $(INST_DIR)/bin/ghc --make HelloWorld
+ $(BIN_DIST_INST_DIR)/bin/ghc --make HelloWorld
./HelloWorld > output
$(CONTEXT_DIFF) output expected_output
diff --git a/distrib/Makefile-bin-vars.in b/distrib/Makefile-bin-vars.in
index 5a54cbfbb6..5603e72708 100644
--- a/distrib/Makefile-bin-vars.in
+++ b/distrib/Makefile-bin-vars.in
@@ -1,21 +1,30 @@
# Where we are
bindist_abs_root = @hardtop@
+FPTOOLS_TOP_ABS = @hardtop@
+
+# This Makefile isn't used on Windows, so wel always have ghc-pkg.bin
+# rather than ghc-pkg.exe.
+GHC_PKG_PROG = $(FPTOOLS_TOP_ABS)/utils/ghc-pkg/ghc-pkg.bin
# Where the different pieces of the bundle should go:
bindir = @bindir@
libdir = @libdir@/$(package)-$(version)
libexecdir = $(libdir)
+datarootdir = @datarootdir@
datadir = @datadir@/$(package)-$(version)
platform = @TargetPlatform@
prefix = @prefix@
exec_prefix = @exec_prefix@
+headerdir = $(libdir)/include
+
# default
-htmldir = $(datadir)/html
-psdir = $(datadir)
-pdfdir = $(datadir)
+docdir = @datadir@/doc/ghc
+htmldir = $(docdir)
+psdir = $(docdir)
+pdfdir = $(docdir)
PERL = @PerlCmd@
@@ -44,6 +53,9 @@ INSTALL_LIB = $(INSTALL) $(INSTALL_LIB_OPTS)
INSTALL_DATA = $(INSTALL) $(INSTALL_DATA_OPTS)
INSTALL_SCRIPT = $(INSTALL) $(INSTALL_SCRIPT_OPTS)
INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_OPTS)
+INSTALL_HEADER = $(INSTALL) $(INSTALL_HEADER_OPTS)
+INSTALL_SHLIB = $(INSTALL) $(INSTALL_SHLIB_OPTS)
+INSTALL_MAN = $(INSTALL) $(INSTALL_MAN_OPTS)
# What's common to all installs
INSTALL_OPTS= $(EXTRA_INSTALL_OPTS)
@@ -56,6 +68,9 @@ INSTALL_LIB_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_LIB_OPTS)
INSTALL_DATA_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_DATA_OPTS)
INSTALL_SCRIPT_OPTS = -m $(BIN_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_SCRIPT_OPTS)
INSTALL_PROGRAM_OPTS = -m $(BIN_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_PROGRAM_OPTS)
+INSTALL_HEADER_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_HEADER_OPTS)
+INSTALL_SHLIB_OPTS = -m $(BIN_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_SHLIB_OPTS)
+INSTALL_MAN_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_MAN_OPTS)
EXECUTABLE_FILE = chmod $(BIN_PERMS)
diff --git a/libraries/Makefile b/libraries/Makefile
index b78eb8c8e9..a90d52cfd8 100644
--- a/libraries/Makefile
+++ b/libraries/Makefile
@@ -322,7 +322,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
install.library.%: installPackage/installPackage ifBuildable/ifBuildable
if ifBuildable/ifBuildable $*; then \
cd $* && \
- ../installPackage/installPackage "$(DESTDIR)" $(prefix) $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)/ghc-pkg-inplace $(DESTDIR)$(libdir)/package.conf; \
+ ../installPackage/installPackage "$(DESTDIR)" $(prefix) $(GHC_PKG_PROG) $(DESTDIR)$(libdir)/package.conf; \
fi
.PHONY: binary-dist binary-dist.library.%
@@ -350,7 +350,7 @@ binary-dist.library.%:
cp $*.cabal $(BIN_DIST_LIBDIR)/$* && \
cp LICENSE $(BIN_DIST_LIBDIR)/$* && \
cp -R dist $(BIN_DIST_LIBDIR)/$* && \
- (cp -RL include $(BIN_DIST_LIBDIR)/$* || :) && \
+ (cp -RL include $(BIN_DIST_LIBDIR)/$* || true) && \
$(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
\( -name "*_split" -o -name "autogen" \) | xargs rm -rf && \
$(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
diff --git a/mk/config.mk.in b/mk/config.mk.in
index c716ab0556..417d6e4583 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -506,9 +506,13 @@ FPTOOLS_TOP_ABS_PLATFORM = @hardtop_plat@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
BIN_DIST_NAME=ghc-$(ProjectVersion)
-BIN_DIST_TOPDIR=$(FPTOOLS_TOP_ABS)
-BIN_DIST_DIR=$(BIN_DIST_TOPDIR)/$(BIN_DIST_NAME)
-BIN_DIST_TARBALL=$(BIN_DIST_TOPDIR)/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
+BIN_DIST_TOPDIR_REL=$(FPTOOLS_TOP)
+BIN_DIST_TOPDIR_ABS=$(FPTOOLS_TOP_ABS)
+BIN_DIST_DIR=$(BIN_DIST_TOPDIR_ABS)/$(BIN_DIST_NAME)
+BIN_DIST_TARBALL=$(BIN_DIST_TOPDIR_REL)/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
+
+BIN_DIST_INST_DIR = $(FPTOOLS_TOP_ABS)/bindisttest/installed
+
#
# Installation directories, we don't use half of these,
@@ -614,6 +618,11 @@ ifeq "$(strip $(mandir))" ""
mandir = $(prefix)/man
endif
+# This is a bit of a lie, as this is a wrapper rather than the program
+# itself. However, it means that we don't have to worry about Windows
+# and non-Windows having different extensions.
+GHC_PKG_PROG = $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)/ghc-pkg-inplace
+
#-----------------------------------------------------------------------------
# install configuration
diff --git a/mk/package.mk b/mk/package.mk
index 60507dbde3..78c01f285e 100644
--- a/mk/package.mk
+++ b/mk/package.mk
@@ -84,7 +84,7 @@ install::
-x c $(PACKAGE_CPP_OPTS) package.conf.in \
| grep -v '^#pragma GCC' \
| sed -e 's/""//g' -e 's/:[ ]*,/: /g' \
- | $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)/ghc-pkg-inplace --global-conf $(DESTDIR)$(libdir)/package.conf update - --force
+ | $(GHC_PKG_PROG) --global-conf $(DESTDIR)$(libdir)/package.conf 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