From e8842f6d21227fe800a495197be0d9f34aa862cc Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 26 Aug 2009 12:29:53 +0000 Subject: [PATCH] Fix bindist creation We were running into problems like: for f in LICENSE configure config.sub config.guess [...] make[2]: execvp: /bin/sh: Argument list too long This patch moves the loop into make, rather than the shell. --- ghc.mk | 5 +---- rules/bindist.mk | 10 +++++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ghc.mk b/ghc.mk index 066d1b6..0f479e1 100644 --- a/ghc.mk +++ b/ghc.mk @@ -805,8 +805,7 @@ install_packages: libffi/package.conf.install rts/package.conf.install # ----------------------------------------------------------------------------- # Binary distributions -# This is split in 2 because of the shell argument limit -$(eval $(call bindist,root1,\ +$(eval $(call bindist,.,\ LICENSE \ configure config.sub config.guess install-sh \ extra-gcc-opts.in \ @@ -827,8 +826,6 @@ $(eval $(call bindist,root1,\ $(INSTALL_BINS) \ $(INSTALL_DOCS) \ $(INSTALL_LIBRARY_DOCS) \ - )) -$(eval $(call bindist,root2,\ $(addsuffix /*,$(INSTALL_HTML_DOC_DIRS)) \ docs/index.html \ $(wildcard libraries/*/dist-install/doc/) \ diff --git a/rules/bindist.mk b/rules/bindist.mk index 4762023..56192a5 100644 --- a/rules/bindist.mk +++ b/rules/bindist.mk @@ -23,6 +23,14 @@ define bindist bindist: bindist_$1 bindist_$1: - for f in $2; do echo $(BIN_DIST_NAME)/$$$$f >> $(BIN_DIST_LIST); done +$(foreach i,$2,$(call bindist_item,$i)) +endef + +define bindist_item + +# $1 = the line +# The formatting of this definition (e.g. the blank line above) is +# important, in order to get make to generate the right makefile code. + for f in $(BIN_DIST_NAME)/$1; do echo $$$$f >> $(BIN_DIST_LIST); done endef -- 1.7.10.4