xref: /aoo41x/main/solenv/gbuild/Tempfile.mk (revision cdf0e10c)
1# Write string to temporary file by chopping into pieces that
2# fit the commandline
3# parameters: filename, maxitems (for one write), string
4# returns: filename
5define var2file
6$(strip $(1)
7$(eval gb_var2file_helpervar := $$(shell printf "%s" "" > $(1) ))\
8$(foreach item,$(3),$(eval gb_var2file_curblock += $(item)
9    ifeq ($$(words $$(gb_var2file_curblock)),$(2))
10        gb_var2file_helpervar := $$(shell printf "%s" "$$(gb_var2file_curblock)" >> $(1) )
11        gb_var2file_curblock :=
12    endif
13    ))\
14    $(eval gb_var2file_helpervar := $(shell echo " "$(gb_var2file_curblock) >> $(1) )
15        gb_var2file_curblock :=
16    ))
17endef
18
19