Simplify usage of generate scripts
This commit is contained in:
parent
71c8f20619
commit
d66f900ba2
@ -85,10 +85,10 @@ do
|
||||
done
|
||||
|
||||
[ $VERBOSE ] && echo "Re-generating library/error.c"
|
||||
scripts/generate_errors.pl include/polarssl scripts/data_files library/error.c
|
||||
scripts/generate_errors.pl
|
||||
|
||||
[ $VERBOSE ] && echo "Re-generating library/version_features.c"
|
||||
scripts/generate_features.pl include/polarssl scripts/data_files library/version_features.c
|
||||
scripts/generate_features.pl
|
||||
|
||||
[ $VERBOSE ] && echo "Re-generating visualc files"
|
||||
scripts/generate_visualc_files.pl
|
||||
|
@ -1,11 +1,32 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# Generate error.c
|
||||
#
|
||||
# Usage: ./generate_errors.pl or scripts/generate_errors.pl without arguments,
|
||||
# or generate_errors.pl include_dir data_dir error_file
|
||||
|
||||
use strict;
|
||||
|
||||
my $include_dir = shift or die "Missing include directory";
|
||||
my $data_dir = shift or die "Missing data directory";
|
||||
my $error_file = shift or die "Missing destination file";
|
||||
my ($include_dir, $data_dir, $error_file);
|
||||
|
||||
if( @ARGV ) {
|
||||
die "Invalid number of arguments" if scalar @ARGV != 3;
|
||||
($include_dir, $data_dir, $error_file) = @ARGV;
|
||||
|
||||
-d $include_dir or die "No such directory: $include_dir\n";
|
||||
-d $data_dir or die "No such directory: $data_dir\n";
|
||||
} else {
|
||||
$include_dir = 'include/polarssl';
|
||||
$data_dir = 'scripts/data_files';
|
||||
$error_file = 'library/error.c';
|
||||
|
||||
unless( -d $include_dir && -d $data_dir ) {
|
||||
chdir '..' or die;
|
||||
-d $include_dir && -d $data_dir
|
||||
or die "Without arguments, must be run from root or scripts\n"
|
||||
}
|
||||
}
|
||||
|
||||
my $error_format_file = $data_dir.'/error.fmt';
|
||||
|
||||
my @low_level_modules = ( "AES", "ASN1", "BLOWFISH", "CAMELLIA", "BIGNUM",
|
||||
|
@ -3,9 +3,26 @@
|
||||
|
||||
use strict;
|
||||
|
||||
my $include_dir = shift or die "Missing include directory";
|
||||
my $data_dir = shift or die "Missing data directory";
|
||||
my $feature_file = shift or die "Missing destination file";
|
||||
my ($include_dir, $data_dir, $feature_file);
|
||||
|
||||
if( @ARGV ) {
|
||||
die "Invalid number of arguments" if scalar @ARGV != 3;
|
||||
($include_dir, $data_dir, $feature_file) = @ARGV;
|
||||
|
||||
-d $include_dir or die "No such directory: $include_dir\n";
|
||||
-d $data_dir or die "No such directory: $data_dir\n";
|
||||
} else {
|
||||
$include_dir = 'include/polarssl';
|
||||
$data_dir = 'scripts/data_files';
|
||||
$feature_file = 'library/version_features.c';
|
||||
|
||||
unless( -d $include_dir && -d $data_dir ) {
|
||||
chdir '..' or die;
|
||||
-d $include_dir && -d $data_dir
|
||||
or die "Without arguments, must be run from root or scripts\n"
|
||||
}
|
||||
}
|
||||
|
||||
my $feature_format_file = $data_dir.'/version_features.fmt';
|
||||
|
||||
my @sections = ( "System support", "PolarSSL modules",
|
||||
|
Loading…
Reference in New Issue
Block a user