aboutsummaryrefslogtreecommitdiffstats
path: root/data/icons/utils.mk
diff options
context:
space:
mode:
Diffstat (limited to 'data/icons/utils.mk')
-rw-r--r--data/icons/utils.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/data/icons/utils.mk b/data/icons/utils.mk
new file mode 100644
index 000000000..84b1c8207
--- /dev/null
+++ b/data/icons/utils.mk
@@ -0,0 +1,11 @@
+# define a variable containing a single space
+blank :=
+space := $(blank) $(blank)
+# split string $3 with $1 as separator and return the token in position $2
+define token
+$(word $2, $(subst $1, ,$3))
+endef
+# split string $3 with $1 as separator and reassemble it using the indexes in $2
+define reorder
+$(subst $(space),$1,$(foreach i,$2,$(call token,$1,$i,$3)))
+endef