use ExtUtils::MakeMaker; use strict ; use vars qw( $VERSION ) ; use File::Find; require 5.00503 ; $VERSION = 0.30 ; my @programs = qw( vcp ) ; my $ui_machines; my @prereqs; my $have_stateml = eval "require StateML"; ## ## Search ui_machines/ for StatML machines so we can build the rule ## for "make ui". The directory "ui_machines" does not ship with ## the distribution, so this rule will not apply to the distribution ## and users need not have StateML installed. ## if ( $have_stateml && -e "ui_machines" ) { my @ui_machines; find( sub { push @ui_machines, $File::Find::name if /\.stml\z/i; }, "ui_machines" ); @prereqs = ( StateML => 0 ); ## Sort by length to get the master machine first, then the others ## Sort by name just to get things in a repeatable order. $ui_machines = join " ", sort { length $a <=> length $b || $a cmp $b } @ui_machines; } # Build a hash of the makefile rules we'll need to build t/test-*.revml my @io_schemes = qw( revml cvs p4 vss ) ; my %io_scheme_revmls = ( ( # batch 0 map { my $fn = "t/test-$_-in-0.revml" ; ## Note the literal tabs here... ( $fn => < $fn TOHERE } @io_schemes, ), ( # batch 1 (incremental) map { my $fn = "t/test-$_-in-1.revml" ; ## Note the literal tabs here... ( $fn => < $fn TOHERE } @io_schemes ), ( # batch 1, --bootstrap map { my $fn = "t/test-$_-in-1-bootstrap.revml" ; ## Note the literal tabs here... ( $fn => < $fn TOHERE } @io_schemes ), ( # batch 0, --no-big-files so some tests can run faster / be less verbose on failure map { my $fn = "t/test-$_-in-0-no-big-files.revml" ; ## Note the literal tabs here... ( $fn => < $fn TOHERE } @io_schemes ), ) ; my $io_test_files = join( ' ', sort keys %io_scheme_revmls ) ; WriteMakefile( 'NAME' => 'VCP', 'VERSION' => $VERSION, 'EXE_FILES' => [ map "bin/$_", @programs ], 'PREREQ_PM' => { 'Digest::MD5' => 0, 'File::Temp' => 0, 'IPC::Run' => 0.75, 'IPC::Run3' => 0, 'MIME::Base64' => 0, 'Regexp::Shellish' => 0.93, 'Text::Diff' => 0, 'XML::ValidWriter' => 0.36, 'XML::Parser' => 0, 'Pod::Links' => 0, # In PodToHtml-xxx.tar.gz @prereqs, }, 'LIBS' => [''], # e.g., '-lm' 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' 'INC' => '', # e.g., '-I/usr/include/other' clean => { FILES => $io_test_files }, ); sub MY::libscan { package MY ; my $self = shift ; my ( $path ) = @_ ; return '' if /\.sw[a-z]$/ ; return '' unless length $self->SUPER::libscan( $path ) ; return $path ; } sub MY::postamble { package MY ; my $self = shift ; return join( "", "\npure_all :: $io_test_files\n", map( "\n$_ : bin/gentrevml\n$io_scheme_revmls{$_}", sort keys %io_scheme_revmls ), "\n\n", "clean_tmp :\n\trm -rf /tmp/vcp*\n\n", "test_all_p4_versions :\n\t./test_all_p4_versions.sh\n\n", defined $ui_machines ? ( "lib/VCP/UIMachines.pm : ui_machines/vcp_ui.tt2 $ui_machines\n", "\txmllint --noout ui_machines/*.stml\n", "\tstml --define package=VCP::UIMachines --template=ui_machines/vcp_ui.tt2 $ui_machines lib/VCP/UIMachines.pm\n", "\t\$(PERL) -Ilib -cw lib/VCP/UIMachines.pm\n", "\n", "ui.png : $ui_machines\n", "\tstml --show-handlers $ui_machines ui.png\n", "\n", "ui.ps : $ui_machines\n", "\tstml --show-handlers $ui_machines ui.ps\n", "\n", "ui : lib/VCP/UIMachines.pm\n\n", "pure_all :: ui\n\n", ) : (), ) ; }