.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)
# Upload the distribution and documentation
ifneq "$(PublishLocation)" ""
-binary-dist :: publish-binary-dist
+publish :: publish-binary-dist
endif
.PHONY: 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!"
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
# 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@
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)
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)
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.%
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 \
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,
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
-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