aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2008-07-14 18:26:45 +0000
committerRalf Wildenhues <rwild@gcc.gnu.org>2008-07-14 18:26:45 +0000
commita4e4a2d60e11be4b4a5184f5187f35da11162e0b (patch)
treeb016a13bb0e343ab0634432f4518068abfee6b5a /gcc
parentcaf55296b96659b2e2635680df283af32f8fa5d7 (diff)
downloadgcc-a4e4a2d60e11be4b4a5184f5187f35da11162e0b.zip
gcc-a4e4a2d60e11be4b4a5184f5187f35da11162e0b.tar.gz
gcc-a4e4a2d60e11be4b4a5184f5187f35da11162e0b.tar.bz2
Makefile.in (write_entries_to_file, [...]): New macros.
gcc/ * Makefile.in (write_entries_to_file, write_entries_to_file_split): New macros. (s-gtyp-input): Use them to write tmp-gi.list. (echo_to_gi.list): Remove. From-SVN: r137791
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/Makefile.in26
2 files changed, 24 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c619f7e..f7924f4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * Makefile.in (write_entries_to_file, write_entries_to_file_split):
+ New macros.
+ (s-gtyp-input): Use them to write tmp-gi.list.
+ (echo_to_gi.list): Remove.
+
2008-07-14 Richard Guenther <rguenther@suse.de>
* tree-ssa-sccvn.c (pre_info): Remove.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a247f91..856dbc3 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -257,6 +257,22 @@ build_file_translate = @build_file_translate@
# Locate mkinstalldirs.
mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
+# write_entries_to_file - writes each entry in a list
+# to the specified file. Entries are written in chunks of
+# $(write_entries_to_file_split) to accomodate systems with
+# severe command-line-length limitations.
+# Parameters:
+# $(1): variable containing entries to iterate over
+# $(2): output file
+write_entries_to_file_split = 50
+write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
+ $(foreach range, \
+ $(shell i=1; while test $$i -le $(words $(1)); do \
+ echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
+ $(shell echo $(wordlist $(range), \
+ $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1)) \
+ | tr ' ' '\n' >> $(2)))
+
# --------
# UNSORTED
# --------
@@ -3196,20 +3212,12 @@ ALL_GTFILES_H := $(sort $(GTFILES_H) $(GTFILES_LANG_H))
# $(GTFILES) may be too long to put on a command line, so we have to
# write it out to a file (taking care not to do that in a way that
# overflows a command line!) and then have gengtype read the file in.
-# The extra blank line in this definition is crucial: it makes the
-# $(foreach ...) below expand to many lines instead of one.
-
-define echo_to_gi.list
-echo '$(gtyp)' >> tmp-gi.list
-
-endef
$(ALL_GTFILES_H) gtype-desc.c gtype-desc.h : s-gtype ; @true
gtyp-input.list: s-gtyp-input ; @true
s-gtyp-input: Makefile
- rm -f tmp-gi.list
- $(foreach gtyp, $(GTFILES), $(echo_to_gi.list))
+ @: $(call write_entries_to_file,$(GTFILES),tmp-gi.list)
$(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list
$(STAMP) s-gtyp-input