Replace inline code in make rules for consistency and maintainability.
data/wordlist.%.inc.pl: tools/mkwordlist data/wordlist.version.txt
$(call cmdsave,$< $*)
data/word%.json: data/word%.inc.pl
- $(call cmdsave,perl -MJSON=encode_json -E "print encode_json(do \$$ARGV[0])" ./$<)
+ $(call cmdsave,tools/mkjson $<)
data/%.json: %.inc.pl
- $(call cmdsave,perl -MJSON -E "print JSON->new->utf8->canonical->encode(do \$$ARGV[0])" ./$<)
+ $(call cmdsave,tools/mkjson $<)
data/wordpairs.inc.pl: data/wordlist.version.txt
tools/wordpairs >$@
--- /dev/null
+#!/usr/bin/env perl
+use 5.012;
+use warnings;
+use JSON;
+
+my $data = do "./$ARGV[0]" or die $@;
+print JSON->new->utf8->canonical->encode($data);