From d4cf5d4513d37691b82833e95f0f4499ec77e057 Mon Sep 17 00:00:00 2001 From: František Dvořák Date: Thu, 11 Dec 2014 19:36:03 +0100 Subject: Support for using utility. --- Makefile | 4 +++- combiner/flac.pl | 12 +++++++++--- combiner/libmad.pl | 8 +++++++- combiner/libmad32.pl | 8 +++++++- combiner/speex.pl | 14 ++++++++++++-- combiner/wavpack.pl | 11 +++++++++-- 6 files changed, 47 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 07e705a..3fbfdc7 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,12 @@ TARGETS=flac libmad libmad32 speex wavpack all: $(TARGETS) clean: - for t in $(TARGETS); do rm -fv $${t}/$${t}.sh; done + for t in $(TARGETS); do rm -fv $${t}/$${t}.sh $${t}/$${t}-parallel.sh; done $(TARGETS): PERLLIB=$$PRERLLIB:combiner combiner/$@.pl > $@/$@.sh chmod +x $@/$@.sh + PERLLIB=$$PRERLLIB:combiner combiner/$@.pl --parallel > $@/$@-parallel.sh + chmod +x $@/$@-parallel.sh .PHONY: $(TARGETS) diff --git a/combiner/flac.pl b/combiner/flac.pl index a4fc025..7aaa928 100755 --- a/combiner/flac.pl +++ b/combiner/flac.pl @@ -32,6 +32,8 @@ my @combs = ( my @inits = (\&nop, \&init_w32, \&init_w64); my @ends = (\&newline, \&newline, \&newline); +my @inits_parallel = (\¶llel, \¶llel_w32, \¶llel_w64); +my @ends_parallel = (\&end_parallel, \&end_parallel, \&end_parallel); my @callbacks = ( sub($$) { @@ -87,6 +89,10 @@ mkdir linux win32 win64 ]; -combiners(\@inits, \@callbacks, \@combs); - -combiners(\@inits, \@callbacks_dec, \@combs); +if ($ARGV[0] eq '--parallel') { + combiners(\@inits_parallel, \@ends_parallel, \@callbacks, \@combs); + combiners(\@inits_parallel, \@ends_parallel, \@callbacks_dec, \@combs); +} else { + combiners(\@inits, \@ends, \@callbacks, \@combs); + combiners(\@inits, \@ends, \@callbacks_dec, \@combs); +} diff --git a/combiner/libmad.pl b/combiner/libmad.pl index 54c1ddc..cb6abb8 100755 --- a/combiner/libmad.pl +++ b/combiner/libmad.pl @@ -21,6 +21,8 @@ my @combs = ( my @inits = (\&nop, \&init_w64); my @ends = (\&newline, \&newline); +my @inits_parallel = (\¶llel, \¶llel_w64); +my @ends_parallel = (\&end_parallel, \&end_parallel); my @callbacks = ( sub($$) { @@ -41,7 +43,11 @@ mkdir linux win64 ]; -combiners(\@inits, \@ends, \@callbacks, \@combs); +if ($ARGV[0] eq '--parallel') { + combiners(\@inits_parallel, \@ends_parallel, \@callbacks, \@combs); +} else { + combiners(\@inits, \@ends, \@callbacks, \@combs); +} print qq[ pushd linux diff --git a/combiner/libmad32.pl b/combiner/libmad32.pl index e1b1ae8..86eb345 100755 --- a/combiner/libmad32.pl +++ b/combiner/libmad32.pl @@ -21,6 +21,8 @@ my @combs = ( my @inits = (\&nop, \&init_w32); my @ends = (\&newline, \&newline); +my @inits_parallel = (\¶llel, \¶llel_w32); +my @ends_parallel = (\&end_parallel, \&end_parallel); my @callbacks = ( sub($$) { @@ -41,7 +43,11 @@ mkdir linux32 win32 ]; -combiners(\@inits, \@ends, \@callbacks, \@combs); +if ($ARGV[0] eq '--parallel') { + combiners(\@inits_parallel, \@ends_parallel, \@callbacks, \@combs); +} else { + combiners(\@inits, \@ends, \@callbacks, \@combs); +} print qq[ pushd linux32 diff --git a/combiner/speex.pl b/combiner/speex.pl index 5f09476..9a93368 100755 --- a/combiner/speex.pl +++ b/combiner/speex.pl @@ -21,6 +21,8 @@ my @combs = ( my @inits = (\&nop, \&init_w64); my @ends = (\&newline, \&newline); +my @inits_parallel = (\¶llel, \¶llel_w64); +my @ends_parallel = (\&end_parallel, \&end_parallel); my @callbacks = ( sub($$) { my ($name, $opts) = @_; @@ -35,6 +37,9 @@ my @callbacks = ( ); my @inits_dec = (\&nop, \&init_w64, \&init_w64); +my @ends_dec = (\&newline, \&newline, \&newline); +my @inits_dec_parallel = (\¶llel, \¶llel_w64, \¶llel_w64); +my @ends_dec_parallel = (\&end_parallel, \&end_parallel, \&end_parallel); my @callbacks_dec = ( sub($$) { my ($name, $opts) = @_; @@ -60,5 +65,10 @@ mkdir linux win64 linux-win64 ]; -combiners(\@inits, \@ends, \@callbacks, \@combs); -combiners(\@inits_dec, \@ends, \@callbacks_dec, \@combs); +if ($ARGV[0] eq '--parallel') { + combiners(\@inits_parallel, \@ends_parallel, \@callbacks, \@combs); + combiners(\@inits_dec_parallel, \@ends_dec_parallel, \@callbacks_dec, \@combs); +} else { + combiners(\@inits, \@ends, \@callbacks, \@combs); + combiners(\@inits_dec, \@ends_dec, \@callbacks_dec, \@combs); +} diff --git a/combiner/wavpack.pl b/combiner/wavpack.pl index 4b359c0..8a29f83 100755 --- a/combiner/wavpack.pl +++ b/combiner/wavpack.pl @@ -32,6 +32,8 @@ my @combs = ( my @inits = (\&nop, \&init_w32, \&init_w64); my @ends = (\&newline, \&newline, \&newline); +my @inits_parallel = (\¶llel, \¶llel_w32, \¶llel_w64); +my @ends_parallel = (\&end_parallel, \&end_parallel, \&end_parallel); my @callbacks = ( sub($$) { @@ -76,5 +78,10 @@ mkdir linux win32 win64 ]; -combiners(\@inits, \@ends, \@callbacks, \@combs); -combiners(\@inits, \@ends, \@callbacks_dec, \@combs); +if ($ARGV[0] eq '--parallel') { + combiners(\@inits_parallel, \@ends_parallel, \@callbacks, \@combs); + combiners(\@inits_parallel, \@ends_parallel, \@callbacks_dec, \@combs); +} else { + combiners(\@inits, \@ends, \@callbacks, \@combs); + combiners(\@inits, \@ends, \@callbacks_dec, \@combs); +} -- cgit