aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorpmichaud <pmichaud@pobox.com>2012-08-28 03:24:06 -0500
committerpmichaud <pmichaud@pobox.com>2012-08-28 03:24:06 -0500
commita127aa7a02cf8b53d8d5dd0cbb623f985f59ad52 (patch)
tree2673021bc8cd77035d379304ba16013819555823 /tools
parent186a6326e820946c9c74150ecfab8bc0aa95334e (diff)
Initial build makefile and script to prefix input lines.
Diffstat (limited to 'tools')
-rw-r--r--tools/star/Makefile50
-rw-r--r--tools/star/prefix.pl12
2 files changed, 62 insertions, 0 deletions
diff --git a/tools/star/Makefile b/tools/star/Makefile
new file mode 100644
index 0000000..1bc35d3
--- /dev/null
+++ b/tools/star/Makefile
@@ -0,0 +1,50 @@
+RAKUDO_VER = 2012.08
+NQP_VER = 2012.08
+PARROT_VER = 4.6.0
+PARROT_REL = supported/$(PARROT_VER)
+
+SRC_DIR = src
+
+RAKUDO_TGZ = rakudo-$(RAKUDO_VER).tar.gz
+RAKUDO_URL = https://github.com/downloads/rakudo/rakudo/$(RAKUDO_TGZ)
+RAKUDO_SRC = $(SRC_DIR)/$(RAKUDO_TGZ)
+NQP_TGZ = nqp-$(NQP_VER).tar.gz
+NQP_URL = https://github.com/downloads/perl6/nqp/$(NQP_TGZ)
+NQP_SRC = $(SRC_DIR)/$(NQP_TGZ)
+PARROT_TGZ = parrot-$(PARROT_VER).tar.gz
+PARROT_URL = http://ftp.parrot.org/releases/$(PARROT_REL)/$(PARROT_TGZ)
+PARROT_SRC = $(SRC_DIR)/$(PARROT_TGZ)
+
+PERL = perl
+PREFIX = $(PERL) $(CURDIR)/tools/star/prefix.pl
+WGET = wget --no-check-certificate
+
+always:
+
+rakudo: nqp $(RAKUDO_SRC)
+ tar --xform 's!rakudo-[^/]*!rakudo!' -xvzf $(RAKUDO_SRC)
+
+$(RAKUDO_SRC):
+ mkdir -p $(SRC_DIR)
+ $(WGET) $(RAKUDO_URL) -O $(RAKUDO_SRC)
+
+nqp: parrot $(NQP_SRC)
+ tar --xform 's!nqp-[^/]*!nqp!' -xvzf $(NQP_SRC)
+
+$(NQP_SRC):
+ mkdir -p $(SRC_DIR)
+ $(WGET) $(NQP_URL) -O $(NQP_SRC)
+
+parrot: $(PARROT_SRC)
+ tar --xform 's!parrot-[^/]*!parrot!' -xvzf $(PARROT_SRC)
+
+$(PARROT_SRC):
+ mkdir -p $(SRC_DIR)
+ $(WGET) $(PARROT_URL) -O $(PARROT_SRC)
+
+MANIFEST: always rakudo/MANIFEST parrot/MANIFEST nqp/MANIFEST
+ git ls-files >MANIFEST
+ $(PREFIX) rakudo/ rakudo/MANIFEST >>MANIFEST
+ $(PREFIX) nqp/ nqp/MANIFEST >>MANIFEST
+ cut -d' ' -f1 parrot/MANIFEST | $(PREFIX) parrot/ >>MANIFEST
+ git submodule foreach --quiet 'git ls-files | $(PREFIX) $$path/' >>MANIFEST
diff --git a/tools/star/prefix.pl b/tools/star/prefix.pl
new file mode 100644
index 0000000..c2dea0a
--- /dev/null
+++ b/tools/star/prefix.pl
@@ -0,0 +1,12 @@
+#! perl
+
+# Add a prefix string (specified by $ARGV[0]) to all
+# of the lines of the remaining files. Skips blank lines
+# and lines beginning with a comment character.
+
+my $prefix = shift @ARGV;
+while (<>) {
+ next if /^\s*(#|$)/;
+ print "$prefix$_";
+}
+