add range(start, end) method to Makefile
authorAndrew Waterman <waterman@cs.berkeley.edu>
Thu, 25 Apr 2013 04:23:39 +0000 (21:23 -0700)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Thu, 25 Apr 2013 04:23:39 +0000 (21:23 -0700)
Makefile.in

index fecd5b018aeb35bb3957948a096c6060471b2912..2630dc4d054bcf333c378faedb1a3b05febe584f 100644 (file)
@@ -119,6 +119,16 @@ INSTALL_LIB   := $(INSTALL) -m 644
 INSTALL_EXE   := $(INSTALL) -m 555
 STOW          := @stow@
 
+#-------------------------------------------------------------------------
+# Range helper function.  $(call range,3,6) generates the string 3 4 5
+#-------------------------------------------------------------------------
+
+range = $(shell _i=$(1); \
+  while [[ $$_i -lt $(2) ]]; do \
+    echo -n "$$_i "; \
+    ((_i = _i + 1)); \
+  done)
+
 #-------------------------------------------------------------------------
 # Include subproject makefile fragments
 #-------------------------------------------------------------------------