Commit 79b5a2cb authored by Ian Lynagh's avatar Ian Lynagh

Fix bindist creation

Bindists should now work again, when doing "make install" at least.
"make in-place" is probably still broken.
parent 430453c5
......@@ -211,18 +211,7 @@ install-docs ::
# binary-dist is a GHC addition for binary distributions
#
ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
BinDistShScripts = ghc-$(ProjectVersion) ghci-$(ProjectVersion) ghc-pkg-$(ProjectVersion) hsc2hs-ghc
else
BinDistShScripts =
endif
BinDistPrlScripts = ghcprof
BinDistLibPrlScripts = ghc-asm ghc-split
BinDistBins = hp2ps runghc
BinDistLinks = ghc ghci ghc-pkg
BinDistLibSplicedFiles = package.conf
BinDistDirs = includes compiler docs driver rts utils
BinDistDirs = includes compiler docs rts
BIN_DIST_TARBALL=ghc-$(ProjectVersion)-$(TARGETPLATFORM).tar.bz2
......@@ -232,7 +221,6 @@ BIN_DIST_TOP= distrib/Makefile \
distrib/README \
ANNOUNCE \
LICENSE \
utils/mkdirhier/mkdirhier \
install-sh \
config.guess \
config.sub \
......@@ -251,7 +239,13 @@ binary-dist:: binary-dist-pre $(BINARY_DIST_PRE_RULES)
binary-dist-pre::
-rm -rf $(BIN_DIST_DIR)
-$(RM) $(BIN_DIST_DIR).tar.gz
$(MKDIRHIER) $(BIN_DIST_DIR)/bin/$(TARGETPLATFORM)
$(MKDIRHIER) $(BIN_DIST_DIR)/mk
echo 'include $$(TOP)/Makefile-vars' > $(BIN_DIST_DIR)/mk/boilerplate.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/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
......@@ -264,6 +258,10 @@ $(BINARY_DIST_PRE_RULES): binary-dist-pre-%:
libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \
datadir=$(BIN_DIST_DIR)/share
binary-dist::
$(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
binary-dist::
......@@ -277,17 +275,11 @@ binary-dist::
echo > $(VARFILE)
echo "package = ghc" >> $(VARFILE)
echo "version = $(ProjectVersion)" >> $(VARFILE)
echo "PACKAGE_SH_SCRIPTS = $(BinDistShScripts)" >> $(VARFILE)
echo "PACKAGE_PRL_SCRIPTS = $(BinDistPrlScripts)" >> $(VARFILE)
echo "PACKAGE_LIB_PRL_SCRIPTS = $(BinDistLibPrlScripts)" >> $(VARFILE)
echo "PACKAGE_LIB_SPLICED_FILES = $(BinDistLibSplicedFiles)" >> $(VARFILE)
echo "PACKAGE_BINS = $(BinDistBins)" >> $(VARFILE)
echo "PACKAGE_OPT_BINS = $(BinDistOptBins)" >> $(VARFILE)
echo "PACKAGE_LINKS = $(BinDistLinks)" >> $(VARFILE)
echo "ProjectVersion = $(ProjectVersion)" >> $(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
( cd $(BIN_DIST_DIR); autoconf )
( cd $(BIN_DIST_DIR); autoreconf )
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
binary-dist::
......@@ -348,35 +340,6 @@ $(BINARY_DIST_DOC_RULES): binary-dist-doc-%:
datadir=$(BIN_DIST_DIR)/share
endif
# Rename scripts to $i.prl and $i.sh where necessary.
# ToDo: do this in a cleaner way...
ifneq "$(BinDistPrlScripts)" ""
binary-dist::
@for i in $(BinDistPrlScripts); do \
echo "Renaming $$i to $$i.prl"; \
$(MV) $(BIN_DIST_DIR)/bin/$(TARGETPLATFORM)/$$i $(BIN_DIST_DIR)/bin/$(TARGETPLATFORM)/$$i.prl; \
done
endif
ifneq "$(BinDistLibPrlScripts)" ""
binary-dist::
@for i in $(BinDistLibPrlScripts); do \
echo "Renaming $$i to $$i.prl"; \
$(MV) $(BIN_DIST_DIR)/lib/$(TARGETPLATFORM)/$$i $(BIN_DIST_DIR)/lib/$(TARGETPLATFORM)/$$i.prl; \
done
endif
ifneq "$(BinDistShScripts)" ""
binary-dist::
@for i in $(BinDistShScripts); do \
if test -x $(BIN_DIST_DIR)/bin/$(TARGETPLATFORM)/$$i ; then \
echo "Renaming $$i to $$i.sh"; \
$(MV) $(BIN_DIST_DIR)/bin/$(TARGETPLATFORM)/$$i $(BIN_DIST_DIR)/bin/$(TARGETPLATFORM)/$$i.sh; \
fi \
done
endif
.PHONY: binary-dist-doc-%
binary-dist::
......
......@@ -1094,4 +1094,71 @@ AC_DEFUN([CHECK_GMP],
AC_REQUIRE([AC_PROG_CC])
])
# --------------------------------------------------------------
# Calculate absolute path to build tree
# --------------------------------------------------------------
AC_DEFUN([FP_FIND_ROOT],[
AC_MSG_CHECKING(for path to top of build tree)
hardtop=`pwd`
dnl Remove common automounter nonsense
dnl
hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|' | sed 's|^//\(.\)/|\1:/|' `
dnl Find 'hardtop_plat', the native format for 'hardtop'
dnl (i.e., right kind of \dnl slashes on a Win32 box, but with b-slashes
dnl being escaped).
dnl
dnl Note OSTYPE: On Cygwin we need to use 'cygpath' to convert
dnl /cygdrive/c/foo to c:/foo but we must not do that if we
dnl aren't building using Cygwin (notably msys), because
dnl cygpath doesn't exist. It seems that 'bash' sets
dnl OSTYPE to 'cygwin' or 'msys' respectively, but cygwin's
dnl 'sh' does not. So we hackily assume that if the shell
dnl hasn't set it to 'msys' then we must be in Cygwin.
dnl Sigh.
dnl
dnl The Right Thing is probably to test $BuildPlatform
dnl instead, but we are sloppy about setting that correctly
dnl at the moment, so we just work around for now.
dnl
dnl The quotes round "$(OSTYPE)" are essential, for the
dnl Cygwin-sh case where OSTYPE is not set.
case $HostPlatform in
i386-unknown-mingw32 | i386-unknown-cygwin32)
if test "${OSTYPE}" != "msys"
then
# convert $hardtop to a path that mingw will understand too
cyghardtop=${hardtop}
hardtop=`cygpath -w ${cyghardtop} | sed -e 's@\\\\@/@g'`
hardtop_plat=`cygpath -w ${cyghardtop} | sed -e 's@\\\\@\\\\\\\\@g'`
else
dnl OK, so we're in the MSYS case. hardtop looks like /c/....
dnl We want to make hardtop_plat into c:/...
dnl Stop using [] for quotes temporarily, so we can use [] in the sed regexp
changequote(, )dnl
hardtop_plat=`echo ${hardtop} | sed -e 's@^/\\([a-zA-Z]\\)/@\\1:/@g'`
changequote([, ])dnl
fi
;;
*)
hardtop_plat=${hardtop}
;;
esac
AC_SUBST(hardtop)
AC_SUBST(hardtop_plat)
AC_MSG_RESULT(${hardtop})
# We don't support building in directories with spaces.
case "$hardtop" in
*' '*) AC_MSG_ERROR([
The build system does not support building in a directory containing
space characters. Suggestion: move the build tree somewhere else.])
;;
esac
])
# LocalWords: fi
......@@ -609,70 +609,7 @@ AC_SUBST(TargetVendor_CPP)
AC_SUBST(exeext)
dnl --------------------------------------------------------------
dnl * Calculate absolute path to build tree
dnl --------------------------------------------------------------
AC_MSG_CHECKING(for path to top of build tree)
hardtop=`pwd`
dnl Remove common automounter nonsense
dnl
hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|' | sed 's|^//\(.\)/|\1:/|' `
dnl Find 'hardtop_plat', the native format for 'hardtop'
dnl (i.e., right kind of \dnl slashes on a Win32 box, but with b-slashes
dnl being escaped).
dnl
dnl Note OSTYPE: On Cygwin we need to use 'cygpath' to convert
dnl /cygdrive/c/foo to c:/foo but we must not do that if we
dnl aren't building using Cygwin (notably msys), because
dnl cygpath doesn't exist. It seems that 'bash' sets
dnl OSTYPE to 'cygwin' or 'msys' respectively, but cygwin's
dnl 'sh' does not. So we hackily assume that if the shell
dnl hasn't set it to 'msys' then we must be in Cygwin.
dnl Sigh.
dnl
dnl The Right Thing is probably to test $BuildPlatform
dnl instead, but we are sloppy about setting that correctly
dnl at the moment, so we just work around for now.
dnl
dnl The quotes round "$(OSTYPE)" are essential, for the
dnl Cygwin-sh case where OSTYPE is not set.
case $HostPlatform in
i386-unknown-mingw32 | i386-unknown-cygwin32)
if test "${OSTYPE}" != "msys"
then
# convert $hardtop to a path that mingw will understand too
cyghardtop=${hardtop}
hardtop=`cygpath -w ${cyghardtop} | sed -e 's@\\\\@/@g'`
hardtop_plat=`cygpath -w ${cyghardtop} | sed -e 's@\\\\@\\\\\\\\@g'`
else
dnl OK, so we're in the MSYS case. hardtop looks like /c/....
dnl We want to make hardtop_plat into c:/...
dnl Stop using [] for quotes temporarily, so we can use [] in the sed regexp
changequote(, )dnl
hardtop_plat=`echo ${hardtop} | sed -e 's@^/\\([a-zA-Z]\\)/@\\1:/@g'`
changequote([, ])dnl
fi
;;
*)
hardtop_plat=${hardtop}
;;
esac
AC_SUBST(hardtop)
AC_SUBST(hardtop_plat)
AC_MSG_RESULT(${hardtop})
# We don't support building in directories with spaces.
case "$hardtop" in
*' '*) AC_MSG_ERROR([
The build system does not support building in a directory containing
space characters. Suggestion: move the build tree somewhere else.])
;;
esac
FP_FIND_ROOT
dnl --------------------------------------------------------------
dnl * Project specific configuration options
......
include Makefile-vars
.PHONY: in-place config-pkgs mk-version-symlinks install-dirs install
config-pkgs ::
@echo "Configuring $(package), version $(version), on $(platform) ..."
@for i in $(PACKAGE_PRL_SCRIPTS) ""; do \
if test "$$i"; then \
echo "Creating a configured version of $$i .."; \
$(RM) bin/$(platform)/$$i.bak; \
if [ -f bin/$(platform)/$$i ]; then $(MV) bin/$(platform)/$$i bin/$(platform)/$$i.bak; fi; \
echo "#! $(PERL)" > bin/$(platform)/$$i ; \
echo '$$'"bindir='$(bindir)';" >> bin/$(platform)/$$i ; \
echo '$$'"libdir='$(libdir)';" >> bin/$(platform)/$$i ; \
echo '$$'"libexecdir='$(libdir)';" >> bin/$(platform)/$$i ; \
echo '$$'"datadir='$(datadir)';" >> bin/$(platform)/$$i ; \
echo '$$'"SED='$(SED)';" >> bin/$(platform)/$$i ; \
echo '$$'"DEFAULT_TMPDIR='$(DEFAULT_TMPDIR)';" >> bin/$(platform)/$$i ; \
cat bin/$(platform)/$$i.prl >> bin/$(platform)/$$i ; \
$(CHMOD) $(BIN_PERMS) bin/$(platform)/$$i; \
echo "Done."; \
fi; \
done
@for i in $(PACKAGE_LIB_PRL_SCRIPTS) ""; do \
if test "$$i"; then \
echo "Creating a configured version of $$i .."; \
$(RM) lib/$(platform)/$$i.bak; \
if [ -f lib/$(platform)/$$i ]; then $(MV) lib/$(platform)/$$i lib/$(platform)/$$i.bak; fi; \
echo "#! $(PERL)" > lib/$(platform)/$$i ; \
echo '$$'"bindir='$(bindir)';" >> lib/$(platform)/$$i ; \
echo '$$'"libdir='$(libdir)';" >> lib/$(platform)/$$i ; \
echo '$$'"libexecdir='$(libdir)';" >> lib/$(platform)/$$i ; \
echo '$$'"datadir='$(datadir)';" >> lib/$(platform)/$$i ; \
echo '$$'"SED='$(SED)';" >> lib/$(platform)/$$i ; \
echo '$$'"DEFAULT_TMPDIR='$(DEFAULT_TMPDIR)';" >> lib/$(platform)/$$i ; \
cat lib/$(platform)/$$i.prl >> lib/$(platform)/$$i; \
$(CHMOD) $(BIN_PERMS) lib/$(platform)/$$i; \
echo "Done."; \
fi; \
done
@for i in $(PACKAGE_SH_SCRIPTS) ""; do \
if test "$$i"; then \
echo "Creating a configured version of $$i .."; \
$(RM) bin/$(platform)/$$i.bak; \
if [ -f bin/$(platform)/$$i ]; then $(MV) bin/$(platform)/$$i bin/$(platform)/$$i.bak; fi; \
echo "#! $(SH)" > bin/$(platform)/$$i ; \
echo "bindir='$(bindir)'" >> bin/$(platform)/$$i ; \
echo "libdir='$(libdir)'" >> bin/$(platform)/$$i ; \
echo "libexecdir='$(libdir)'" >> bin/$(platform)/$$i ; \
echo "datadir='$(datadir)'" >> bin/$(platform)/$$i ; \
echo "SED='$(SED)'" >> bin/$(platform)/$$i ; \
echo "DEFAULT_TMPDIR='$(DEFAULT_TMPDIR)'" >> bin/$(platform)/$$i ; \
cat bin/$(platform)/$$i.sh >> bin/$(platform)/$$i; \
$(CHMOD) $(BIN_PERMS) bin/$(platform)/$$i; \
echo "Done."; \
fi; \
done
@for i in $(PACKAGE_LIB_SPLICED_FILES) ""; do \
if test "$$i"; then \
echo "Creating a configured version of $$i .."; \
$(PERL) -i.bak -lpe 's|\$$libdir|$(libdir)|g;s|\$$datadir|$(datadir)|g' lib/$(platform)/$$i; \
fi; \
done
@if test "$(platform)" = "powerpc-apple-darwin"; then \
echo "Configuring install names..."; \
for i in lib/$(platform)/*; do \
sh fix_install_names.sh "$(libdir)" "$$i"; \
done; \
echo "Done."; \
fi
.PHONY: in-place mk-version-symlinks install-dirs install
in-place ::
$(MAKE) $(MFLAGS) config-pkgs bindir=`pwd`/bin/$(platform) libdir=`pwd`/lib/$(platform) datadir=`pwd`/share
@if test -x "./post-inplace-script" ; then \
echo "Running project-specific post-inplace script ..." ; \
./post-inplace-script $(platform) `pwd` \
......@@ -82,12 +14,12 @@ in-place ::
install-dirs ::
$(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' {} \; )
(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 :: config-pkgs install-dirs install-bin install-libs install-datas install-docs postinstall denounce
install :: install-dirs install-driver install-utils install-libs install-datas install-docs postinstall denounce
.PHONY: install-bin install-libs install-datas postinstall denounce
.PHONY: install-libs install-utils install-datas postinstall denounce
denounce:
@echo
......@@ -112,38 +44,18 @@ postinstall:
echo "Done" ; \
fi
install-bin:
for i in $(PACKAGE_BIN_INSTALL) ""; do \
if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i $(bindir); fi; \
done;
for i in $(PACKAGE_BINS) ""; do \
if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i$(exeext) $(bindir); fi; \
done;
for i in $(PACKAGE_OPT_BINS) ""; do \
if test -n "$$i" -a ! -f "$(bindir)/$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i$(exeext) $(bindir); fi; \
done;
@for i in $(VERSION_SYMLINKS_FOR) ""; do \
if [ "x$$i" != "x" ]; then \
( cd $(bindir); \
if ( $(PERL) -e '$$fn="'$$i'"; exit ((! -f $$fn || -l $$fn) ? 0 : 1);' ); then \
echo "Creating a symbolic link from $$i-$(version) to $$i"; \
$(RM) $$i; \
$(LN_S) $$i-$(version) $$i; \
else \
echo "Creating a symbolic link from $$i-$(version) to $$i failed: \`$$i' already exists"; \
echo "Perhaps remove \`$$i' manually?"; \
exit 1; \
fi;\
); \
fi; \
done
install-libs:
(cd lib/$(platform); find . -type f -exec sh -c '$(CP) $$0 $(libdir)/$$0' {} \; )
$(MAKE) -C libraries install IN_BIN_DIST=1
$(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:
for i in `(cd share; find . -type f )`; do \
set -e; for i in `(cd share; find . -type f )`; do \
$(INSTALL_DATA) share/$$i $(datadir)/$$i; \
done
......@@ -161,7 +73,7 @@ show-install-setup:
install-docs : install-dirs-docs
if test -d share/html ; then $(CP) -r share/html/* $(htmldir) ; fi
for i in share/*.ps; do \
set -e; for i in share/*.ps; do \
if test -f "$$i"; then \
$(CP) $$i $(psdir) ; \
fi \
......
# Where we are
bindist_abs_root = @hardtop@
# Where the different pieces of the bundle should go:
bindir = @bindir@
libdir = @libdir@/$(package)-$(version)
libexecdir = $(libdir)
datadir = @datadir@/$(package)-$(version)
platform = @TargetPlatform@
......@@ -26,28 +30,17 @@ exeext = @exeext@
SED = @SedCmd@
DEFAULT_TMPDIR = /tmp
# sigh
INSTALL_DIR = ./mkdirhier
#
# Set of package scripts for which you'd like a name-<version> symlink
# to be created, i.e., create a symlink, ghc-$(version), pointing to ghc to
# avoid version vertigo.
#
VERSION_SYMLINKS_FOR=$(PACKAGE_LINKS)
# Binaries to install
PACKAGE_BIN_INSTALL=$(PACKAGE_PRL_SCRIPTS) $(PACKAGE_SH_SCRIPTS)
#----------end of user-serviceable parts------------
#
#
# How to install the different pieces
#
INSTALL_BIN = $(INSTALL) $(INSTALL_BIN_OPTS)
INSTALL_LIB = $(INSTALL) $(INSTALL_LIB_OPTS)
INSTALL_DATA = $(INSTALL) $(INSTALL_DATA_OPTS)
INSTALL_SCRIPT = $(INSTALL) $(INSTALL_SCRIPT_OPTS)
INSTALL_DIR = $(bindist_abs_root)/utils/mkdirhier/mkdirhier
INSTALL_BIN = $(INSTALL) $(INSTALL_BIN_OPTS)
INSTALL_LIB = $(INSTALL) $(INSTALL_LIB_OPTS)
INSTALL_DATA = $(INSTALL) $(INSTALL_DATA_OPTS)
INSTALL_SCRIPT = $(INSTALL) $(INSTALL_SCRIPT_OPTS)
INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_OPTS)
# What's common to all installs
INSTALL_OPTS= $(EXTRA_INSTALL_OPTS)
......@@ -55,8 +48,13 @@ INSTALL_OPTS= $(EXTRA_INSTALL_OPTS)
BIN_PERMS = 755
LIB_PERMS = 644
INSTALL_BIN_OPTS = -m $(BIN_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_BIN_OPTS)
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_BIN_OPTS = -m $(BIN_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_BIN_OPTS)
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)
EXECUTABLE_FILE = chmod $(BIN_PERMS)
GHC_COMPAT_DIR=$(TOP)/mk
......@@ -108,6 +108,8 @@ echo "Which we'll further canonicalise into: $TargetPlatform"
AC_SUBST(TargetPlatform)
AC_SUBST(exeext)
FP_FIND_ROOT
#
dnl ** Check Perl installation **
#
......
......@@ -25,4 +25,10 @@ INSTALL_DATAS += package.conf ghc-usage.txt ghci-usage.txt
# re-installing packages.
CLEAN_FILES += package.conf* stamp-pkg-conf*
binary-dist:
$(INSTALL_DIR) $(BIN_DIST_DIR)/driver
$(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/driver
$(INSTALL_DATA) $(INSTALL_DATAS) $(BIN_DIST_DIR)/driver
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d binary-dist; done
include $(TOP)/mk/target.mk
......@@ -23,4 +23,8 @@ endif
# -----------------------------------------------------------------------------
binary-dist:
$(INSTALL_DIR) $(BIN_DIST_DIR)/driver/ghc
$(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/driver/ghc/
include $(TOP)/mk/target.mk
......@@ -61,4 +61,8 @@ ghci.res : ghci.rc ghci.ico
windres -o ghci.res -i ghci.rc -O coff
endif
binary-dist:
$(INSTALL_DIR) $(BIN_DIST_DIR)/driver/ghci
$(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/driver/ghci/
include $(TOP)/mk/target.mk
......@@ -20,4 +20,9 @@ ifeq "$(BootingFromHc)" "YES"
boot :: all
endif
binary-dist:
$(INSTALL_DIR) $(BIN_DIST_DIR)/driver/mangler
$(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/driver/mangler/
$(INSTALL_PROGRAM) $(PROG) $(BIN_DIST_DIR)/driver/mangler/
include $(TOP)/mk/target.mk
......@@ -15,4 +15,9 @@ all:: $(PROG).prl
INSTALL_LIBEXEC_SCRIPTS += $(PROG)
CLEAN_FILES += $(PROG) $(PROG).prl
binary-dist:
$(INSTALL_DIR) $(BIN_DIST_DIR)/driver/split
$(INSTALL_DATA) Makefile $(BIN_DIST_DIR)/driver/split/
$(INSTALL_PROGRAM) $(PROG) $(BIN_DIST_DIR)/driver/split/
include $(TOP)/mk/target.mk
......@@ -24,14 +24,10 @@
default_target: build
ifeq "$(IN_BIN_DIST)" "1"
include ../Makefile-vars
else
# Ideally we'd just include something to give us variables
# for paths and arguments to tools etc, and those set in mk/build.mk.
TOP=.
TOP=..
include $(TOP)/mk/boilerplate.mk
endif
SUBDIRS = base old-locale old-time directory process filepath pretty \
template-haskell readline Cabal random haskell98
......@@ -89,6 +85,10 @@ else
dot_bat=
endif
# -----------------------------------------------------------------------------
ifneq "$(DOING_BIN_DIST)" "YES"
CONFIGURE_OPTS =
CONFIGURE_STAMP_EXTRAS :=
......@@ -226,6 +226,25 @@ doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
%/setup/Setup ifBuildable/ifBuildable
ifBuildable/ifBuildable $* setup/Setup haddock
.PHONY: distclean clean clean.library.%
distclean: clean
clean: $(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR))
$(RM) -f stamp/bootstrapping.*
$(RM) -rf bootstrapping.*
$(RM) -rf ifBuildable
$(RM) -f libraries.txt index.html doc-index.html
$(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)): \
clean.library.%:
$(RM) -f stamp/configure.library.*.$* $*/unbuildable
-cd $* && setup/Setup clean
$(RM) -rf $*/setup
endif
# -----------------------------------------------------------------------------
.PHONY: install install-docs install.library.%
ROOT=$(prefix)/share/ghc/doc/html/
......@@ -259,6 +278,8 @@ BIN_DIST_LIBDIR=$(BIN_DIST_DIR)/libraries
binary-dist: $(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR))
mkdir $(BIN_DIST_LIBDIR)/installPackage
cp installPackage/installPackage $(BIN_DIST_LIBDIR)/installPackage
mkdir $(BIN_DIST_LIBDIR)/ifBuildable
cp ifBuildable/ifBuildable $(BIN_DIST_LIBDIR)/ifBuildable
cp Makefile $(BIN_DIST_LIBDIR)
cp gen_contents_index $(BIN_DIST_LIBDIR)
cp index.html $(BIN_DIST_LIBDIR)
......@@ -269,26 +290,13 @@ $(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR)): \
binary-dist.library.%:
$(MKDIRHIER) $(BIN_DIST_LIBDIR)/$*
ifBuildable/ifBuildable $* cp $*.cabal $(BIN_DIST_LIBDIR)/$*
ifBuildable/ifBuildable $* cp .setup-config $(BIN_DIST_LIBDIR)/$*
ifBuildable/ifBuildable $* cp -a dist $(BIN_DIST_LIBDIR)/$*
# Euch
ifBuildable/ifBuildable $* cp -aL include $(BIN_DIST_LIBDIR)/$* || :
ifBuildable/ifBuildable $* $(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
\( -name "*_split" -o -name "autogen" \) | xargs rm -rf
ifBuildable/ifBuildable $* $(FIND) $(BIN_DIST_LIBDIR)/$*/dist \
\( \( -name "*.o" -o -name "*.p_o" \) -a ! -name "HS*" \) \
-exec rm {} \;
.PHONY: distclean clean clean.library.%
distclean: clean
clean: $(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR))
$(RM) -f stamp/bootstrapping.*
$(RM) -rf bootstrapping.*
$(RM) -rf ifBuildable
$(RM) -f libraries.txt index.html doc-index.html
$(foreach SUBDIR,$(SUBDIRS),clean.library.$(SUBDIR)): \
clean.library.%:
$(RM) -f stamp/configure.library.*.$* $*/unbuildable
-cd $* && setup/Setup clean
$(RM) -rf $*/setup
# Begin by slurping in the boilerplate from one level up.
# Remember, TOP is the top level of the innermost level
# (FPTOOLS_TOP is the fptools top)
# We need to set TOP to be the TOP that the next level up expects!
# The TOP variable is reset after the inclusion of the fptools
# boilerplate, so we stash TOP away first:
LIBRARIES_TOP := $(TOP)
TOP:=$(TOP)/..
# Pull in the fptools boilerplate
include $(TOP)/mk/boilerplate.mk
# Reset TOP
TOP:=$(LIBRARIES_TOP)
# -----------------------------------------------------------------
# Everything after this point
# augments or overrides previously set variables.
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/opts.mk
-include $(TOP)/mk/suffix.mk
# $Id: target.mk,v 1.12 2002/07/02 13:49:27 simonmar Exp $
TOP:=$(TOP)/..
# All the libs in here are "hierarchical", this flag tell the
# installation machinery to make sure that when installing interface
# files we maintain the directory structure.
HIERARCHICAL_LIB = YES
# NOT YET: Haddock needs to understand about .raw-hs files
#
# Set our source links to point to the CVS repository on the web.
# SRC_HADDOCK_OPTS += -s http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libaries/$(PACKAGE)