Commit 0fef9545 authored by Ian Lynagh's avatar Ian Lynagh

Move the libraries bindist generation code into libraries/Makefile

This should mean it works even when some libraries are unbuildable.
parent 6ac403be
......@@ -223,10 +223,6 @@ BinDistLinks = ghc ghci ghc-pkg
BinDistLibSplicedFiles = package.conf
BinDistDirs = includes compiler docs driver rts utils
BIN_DIST_NAME=ghc-$(ProjectVersion)
BIN_DIST_TOPDIR=$(FPTOOLS_TOP_ABS)
BIN_DIST_DIR=$(BIN_DIST_TOPDIR)/$(BIN_DIST_NAME)
BIN_DIST_TARBALL=ghc-$(ProjectVersion)-$(TARGETPLATFORM).tar.bz2
BIN_DIST_TOP= distrib/Makefile \
......@@ -332,6 +328,7 @@ binary-dist :: $(BINARY_DIST_DOC_RULES)
$(BINARY_DIST_DOC_RULES): binary-dist-doc-%:
$(MAKE) -C $* $(MFLAGS) $(BINDIST_DOC_WAYS)
$(MAKE) -C $* $(MFLAGS) install-docs \
MAKING_BIN_DIST=1
XMLDocWays="$(BINDIST_DOC_WAYS)" \
prefix=$(BIN_DIST_DIR) \
exec_prefix=$(BIN_DIST_DIR) \
......@@ -372,27 +369,8 @@ endif
.PHONY: binary-dist-doc-%
BIN_DIST_LIBDIR=$(BIN_DIST_DIR)/libraries
LIBRARY_SUBDIRS=$(shell $(MAKE) -s -C libraries subdirs)
BINARY_DIST_LIBRARY_RULES=$(foreach d,$(LIBRARY_SUBDIRS),binary-dist-lib-$d)
binary-dist:: $(BINARY_DIST_LIBRARY_RULES)
cp libraries/Makefile $(BIN_DIST_LIBDIR)
cp libraries/gen_contents_index $(BIN_DIST_LIBDIR)
cp libraries/index.html $(BIN_DIST_LIBDIR)
cp libraries/doc-index.html $(BIN_DIST_LIBDIR)
cp -a libraries/stamp $(BIN_DIST_LIBDIR)
$(BINARY_DIST_LIBRARY_RULES): binary-dist-lib-%:
$(MKDIRHIER) $(BIN_DIST_LIBDIR)/$*/setup
cp libraries/$*/setup/Setup $(BIN_DIST_LIBDIR)/$*/setup
cp libraries/$*/*.cabal $(BIN_DIST_LIBDIR)/$*
cp -a libraries/$*/dist $(BIN_DIST_LIBDIR)/$*
find $(BIN_DIST_LIBDIR)/$*/dist \
\( \( -name "*.o" -o -name "*.p_o" \) -a \! -name "HS*" \) \
-exec rm {} \;
binary-dist::
$(MAKE) -C libraries binary-dist
# Jiggle the files around to make a valid Windows distribution if necessary
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
......
......@@ -226,6 +226,26 @@ install.library.%: stamp/configure.library.install.% \
%/setup/Setup ifBuildable/ifBuildable
ifBuildable/ifBuildable $* setup/Setup install
.PHONY: binary-dist binary-dist.library.%
BIN_DIST_LIBDIR=$(BIN_DIST_DIR)/libraries
binary-dist: $(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR))
cp Makefile $(BIN_DIST_LIBDIR)
cp gen_contents_index $(BIN_DIST_LIBDIR)
cp index.html $(BIN_DIST_LIBDIR)
cp doc-index.html $(BIN_DIST_LIBDIR)
cp -a stamp $(BIN_DIST_LIBDIR)
$(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR)): \
binary-dist.library.%:
$(MKDIRHIER) $(BIN_DIST_LIBDIR)/$*/setup
ifBuildable/ifBuildable $* cp setup/Setup $(BIN_DIST_LIBDIR)/$*/setup
ifBuildable/ifBuildable $* cp $*.cabal $(BIN_DIST_LIBDIR)/$*
ifBuildable/ifBuildable $* cp -a dist $(BIN_DIST_LIBDIR)/$*
ifBuildable/ifBuildable $* find $(BIN_DIST_LIBDIR)/$*/dist \
\( -name "*.o" -o -name "*.p_o" -o -name "HS*" \) -exec rm {} \;
.PHONY: distclean clean clean.library.%
distclean: clean
......
......@@ -502,6 +502,10 @@ FPTOOLS_TOP_ABS = @hardtop@
# The platform specific version of 'hardtop'.
FPTOOLS_TOP_ABS_PLATFORM = @hardtop_plat@
BIN_DIST_NAME=ghc-$(ProjectVersion)
BIN_DIST_TOPDIR=$(FPTOOLS_TOP_ABS)
BIN_DIST_DIR=$(BIN_DIST_TOPDIR)/$(BIN_DIST_NAME)
#
# Installation directories, we don't use half of these,
# but since the configure script has them on offer while
......
TOP=..
include $(TOP)/mk/boilerplate.mk
ifneq "$(BIN_DIST_NAME)" ""
ifeq "$(MAKING_BIN_DIST)" "1"
# We're doing a binary-dist, descend into a subset of the dirs.
SUBDIRS = hp2ps unlit
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment