latin: common tool to dump static perl include
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 16 May 2017 19:39:39 +0000 (21:39 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 May 2017 17:29:34 +0000 (19:29 +0200)
Move inline code to reusable script.

Makefile
tools/perlinc-static [new file with mode: 0755]

index 43323a15d08e1e59557e5607682e117bf4a54cc1..103a3be4fac806b6856aafd303808a1b3c3be62f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -117,6 +117,6 @@ clean:
 
 .SECONDEXPANSION:
 
 
 .SECONDEXPANSION:
 
-data/writing-latn.inc.pl: $$(@F)
-       perl -MData::Dumper -wE 'my @t = do "$<" or die $$@; print Data::Dumper->new([\@t])->Terse(1)->Quotekeys(0)->Indent(1)->Dump' | sponge $@
+data/writing-latn.inc.pl: tools/perlinc-static $$(@F)
+       $< $(word 2,$^) | sponge $@
 
 
diff --git a/tools/perlinc-static b/tools/perlinc-static
new file mode 100755 (executable)
index 0000000..4edf5ac
--- /dev/null
@@ -0,0 +1,8 @@
+#!/usr/bin/env perl
+use 5.014;
+use warnings;
+
+use Data::Dumper;
+
+my @data = do $ARGV[0] or die $@;
+print Data::Dumper->new([\@data])->Terse(1)->Quotekeys(0)->Indent(1)->Dump;