summaryrefslogtreecommitdiff
path: root/solenv/gbuild/Tempfile.mk
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2011-01-27 09:47:18 +0100
committerMathias Bauer <mba@openoffice.org>2011-01-27 09:47:18 +0100
commit079e072e186a2e267284a2c4354f5f18843ea0a7 (patch)
tree4ce1f523547ef96cdf7728ec1806f0929446774d /solenv/gbuild/Tempfile.mk
parenta239103a877de032e11acfa645d059c45fd28d10 (diff)
CWS gnumake2: use temp files for long command lines; missing include path in editeng
Diffstat (limited to 'solenv/gbuild/Tempfile.mk')
-rw-r--r--solenv/gbuild/Tempfile.mk38
1 files changed, 38 insertions, 0 deletions
diff --git a/solenv/gbuild/Tempfile.mk b/solenv/gbuild/Tempfile.mk
new file mode 100644
index 000000000000..44ae6025c3e4
--- /dev/null
+++ b/solenv/gbuild/Tempfile.mk
@@ -0,0 +1,38 @@
+# Write string to temporary file by chopping into pieces that
+# fit the commandline
+# parameters: filename, maxitems (for one write), string
+# returns: filename
+define var2file
+$(strip $(1)
+$(eval gb_var2file_helpervar := $$(shell printf "%s" "" > $(1) ))\
+$(foreach item,$(3),$(eval gb_var2file_curblock += $(item)
+ ifeq ($$(words $$(gb_var2file_curblock)),$(2))
+ gb_var2file_helpervar := $$(shell printf "%s" "$$(gb_var2file_curblock)" >> $(1) )
+ gb_var2file_curblock :=
+ endif
+ ))\
+ $(eval gb_var2file_helpervar := $(shell echo " "$(gb_var2file_curblock) >> $(1) )
+ gb_var2file_curblock :=
+ ))
+endef
+
+#define var2file
+#$(strip $(1))\
+#$(eval
+#gb_Helper_STARTS := $$(shell seq 1 $(2) $$(words $(3)))
+#gb_Helper_ENDS := $$(shell seq $(2) $(2) $$(words $(3))) $$(words $(3))
+#gb_Helper_RUNS := $$(shell seq $$(words $$(gb_Helper_STARTS)))
+#$$(shell printf "" > $(1))
+#$$(foreach bufferrun,$$(gb_Helper_RUNS),\
+# $$(shell printf "%s" \
+# "$$(if $$(filter-out 1,$$(bufferrun)), )$$(wordlist \
+# $$(word $$(bufferrun),$$(gb_Helper_STARTS)),\
+# $$(word $$(bufferrun),$$(gb_Helper_ENDS)),$(3))" >> $(1)))
+#$$(shell printf "\n" >> $(1))
+#)
+#endef
+
+define uniqname
+$(shell mktemp | tr -d '\n')
+endef
+