summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Grabsch <v@njh.eu>2015-01-11 23:14:14 (GMT)
committerVolker Grabsch <v@njh.eu>2015-01-11 23:20:36 (GMT)
commitdacd2ba109bb588d44eb5432d685077c37a043dc (patch)
tree7d3f81e7784ddbe3b79e97d6bf60550838b8c7c5
parent40fd96e2366c243f896d5aacbbd43ca8da86ad54 (diff)
downloadmxe-dacd2ba109bb588d44eb5432d685077c37a043dc.zip
mxe-dacd2ba109bb588d44eb5432d685077c37a043dc.tar.gz
mxe-dacd2ba109bb588d44eb5432d685077c37a043dc.tar.bz2
Do not execute too many shell commands at once in "cleanup-style"
Otherwise, the argument to "bash -c ..." is very large, resulting in the following error message on systems with small ARG_MAX: make: execvp: bash: Argument list too long
-rw-r--r--Makefile30
1 files changed, 16 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index b20810f..8fa27a0 100644
--- a/Makefile
+++ b/Makefile
@@ -301,18 +301,20 @@ update-checksum-%:
$(error package $* not found in index.html))
.PHONY: cleanup-style
+define CLEANUP_STYLE
+ @$(SED) ' \
+ s/\r//g; \
+ s/[ \t]\+$$//; \
+ s,^#!/bin/bash$$,#!/usr/bin/env bash,; \
+ $(if $(filter %Makefile,$(1)),,\
+ s/\t/ /g; \
+ ) \
+ ' < $(1) > $(TOP_DIR)/tmp-cleanup-style; \
+ diff -u $(1) $(TOP_DIR)/tmp-cleanup-style >/dev/null \
+ || { echo '[cleanup] $(1)'; \
+ cp $(TOP_DIR)/tmp-cleanup-style $(1); }; \
+ rm -f $(TOP_DIR)/tmp-cleanup-style
+
+endef
cleanup-style:
- @$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),\
- $(SED) ' \
- s/\r//g; \
- s/[ \t]\+$$//; \
- s,^#!/bin/bash$$,#!/usr/bin/env bash,; \
- $(if $(filter %Makefile,$(FILE)),,\
- s/\t/ /g; \
- ) \
- ' < $(FILE) > $(TOP_DIR)/tmp-cleanup-style; \
- diff -u $(FILE) $(TOP_DIR)/tmp-cleanup-style >/dev/null \
- || { echo '[cleanup] $(FILE)'; \
- cp $(TOP_DIR)/tmp-cleanup-style $(FILE); }; \
- rm -f $(TOP_DIR)/tmp-cleanup-style; \
- )
+ $(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),$(call CLEANUP_STYLE,$(FILE)))