Makefile: use shell for-loop rather than Make's foreach loop during install
The install target uses a foreach loop to generate a single long shell command line to handle installation of the built-in git commands. The maximum length of the argument list varies by platform, and this use of foreach quickly grows the length of the argument list. Current git can exceed the default maximum argument list length on IRIX 6.5 of 20480 depending on the installation path. Rather than using make's foreach loop to pre-generate the shell command line, use a shell for-loop and allow the shell to iterate through each of the built-in commands. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Casey committed
Jan 19, 2009 at 19:44 UTC
b56c79ccea73fe53af3f3a3cc5ab7f5417fc898d
1 file changed
+6
-4
Makefile
+6
-4
@@ -1441,10 +1441,12 @@ endif
1441
{ $(RM) "$$execdir/git-add$X" && \
1442
ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \
1443
cp git-add$X "$$execdir/git-add$X"; } && \
1444
- { $(foreach p,$(filter-out git-add$X,$(BUILT_INS)), $(RM) "$$execdir/$p" && \
1445
- ln "$$execdir/git-add$X" "$$execdir/$p" 2>/dev/null || \
1446
- ln -s "git-add$X" "$$execdir/$p" 2>/dev/null || \
1447
- cp "$$execdir/git-add$X" "$$execdir/$p" || exit;) } && \
1444
+ { for p in $(filter-out git-add$X,$(BUILT_INS)); do \
1445
+ $(RM) "$$execdir/$$p" && \
1446
+ ln "$$execdir/git-add$X" "$$execdir/$$p" 2>/dev/null || \
1447
+ ln -s "git-add$X" "$$execdir/$$p" 2>/dev/null || \
1448
+ cp "$$execdir/git-add$X" "$$execdir/$$p" || exit; \
1449
+ done } && \
1450
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
1451
1452
install-doc: