Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions generate_def.sh

This file was deleted.

31 changes: 25 additions & 6 deletions helper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,26 @@ sub update_dep
}

sub generate_def {
system("sh", "generate_def.sh");
my @files = split /\n/, `git ls-files`;
@files = grep(/\.c/, @files);
@files = map { my $x = $_; $x =~ s/^bn_|\.c$//g; $x; } @files;
@files = grep(!/mp_radix_smap/, @files);

@files = grep(!/conversion/, @files);
push(@files, qw(mp_set_i32 mp_set_i64 mp_set_u32 mp_set_u64 mp_set_int mp_set_long mp_set_long_long mp_get_i32 mp_get_i64 mp_get_mag32 mp_get_mag64 mp_get_int mp_get_long mp_get_long_long mp_init_i32 mp_init_i64 mp_init_u32 mp_init_u64 mp_init_set_int));

my $files = join("\n ", sort(grep(/^mp_/, @files)));
write_file "tommath.def", "; libtommath
;
; Use this command to produce a 32-bit .lib file, for use in any MSVC version
; lib -machine:X86 -name:libtommath.dll -def:tommath.def -out:tommath.lib
; Use this command to produce a 64-bit .lib file, for use in any MSVC version
; lib -machine:X64 -name:libtommath.dll -def:tommath.def -out:tommath.lib
;
EXPORTS
$files
";
return 0;
}

sub die_usage {
Expand All @@ -446,7 +465,7 @@ sub die_usage {
$0 -o OR $0 --check-comments
$0 -m OR $0 --check-makefiles
$0 -a OR $0 --check-all
$0 -u OR $0 --update-makefiles
$0 -u OR $0 --update-files
MARKER
}

Expand All @@ -455,7 +474,7 @@ sub die_usage {
"m|check-makefiles" => \my $check_makefiles,
"d|check-doc" => \my $check_doc,
"a|check-all" => \my $check_all,
"u|update-makefiles" => \my $update_makefiles,
"u|update-files" => \my $update_files,
"h|help" => \my $help
) or die_usage;

Expand All @@ -464,9 +483,9 @@ sub die_usage {
$failure ||= check_comments() if $check_all || $check_comments;
$failure ||= check_doc() if $check_doc; # temporarily excluded from --check-all
$failure ||= process_makefiles(0) if $check_all || $check_makefiles;
$failure ||= process_makefiles(1) if $update_makefiles;
$failure ||= update_dep() if $update_makefiles;
$failure ||= generate_def() if $update_makefiles;
$failure ||= process_makefiles(1) if $update_files;
$failure ||= update_dep() if $update_files;
$failure ||= generate_def() if $update_files;

die_usage unless defined $failure;
exit $failure ? 1 : 0;
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ zipup: clean astyle new_file manual poster docs
gpg -b -a ltm-$(VERSION).zip

new_file:
perl helper.pl --update-makefiles
perl helper.pl --update-files

perlcritic:
perlcritic *.pl doc/*.pl
Expand Down
4 changes: 2 additions & 2 deletions testme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ if [[ "$CHECK_FORMAT" == "1" ]]
then
make astyle
_check_git "make astyle"
perl helper.pl --update-makefiles
_check_git "helper.pl --update-makefiles"
perl helper.pl --update-files
_check_git "helper.pl --update-files"
perl helper.pl --check-all
_check_git "helper.pl --check-all"
exit $?
Expand Down
17 changes: 8 additions & 9 deletions tommath.def
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ EXPORTS
mp_copy
mp_count_bits
mp_decr
mp_div
mp_div_2
mp_div_2d
mp_div_3
mp_div
mp_div_d
mp_dr_is_modulus
mp_dr_reduce
Expand Down Expand Up @@ -63,25 +63,25 @@ EXPORTS
mp_init_u32
mp_init_u64
mp_invmod
mp_is_square
mp_iseven
mp_isodd
mp_is_square
mp_kronecker
mp_lcm
mp_lshd
mp_mod_2d
mp_mod
mp_mod_2d
mp_mod_d
mp_montgomery_calc_normalization
mp_montgomery_reduce
mp_montgomery_setup
mp_mul
mp_mul_2
mp_mul_2d
mp_mul
mp_mul_d
mp_mulmod
mp_neg
mp_n_root
mp_neg
mp_or
mp_prime_fermat
mp_prime_frobenius_underwood
Expand All @@ -93,15 +93,14 @@ EXPORTS
mp_prime_strong_lucas_selfridge
mp_radix_size
mp_rand
mp_rand_digit
mp_read_radix
mp_read_signed_bin
mp_read_unsigned_bin
mp_reduce
mp_reduce_2k
mp_reduce_2k_l
mp_reduce_2k_setup
mp_reduce_2k_setup_l
mp_reduce
mp_reduce_is_2k
mp_reduce_is_2k_l
mp_reduce_setup
Expand All @@ -125,12 +124,12 @@ EXPORTS
mp_sub
mp_sub_d
mp_submod
mp_toradix
mp_toradix_n
mp_to_signed_bin
mp_to_signed_bin_n
mp_to_unsigned_bin
mp_to_unsigned_bin_n
mp_toradix
mp_toradix_n
mp_unsigned_bin_size
mp_xor
mp_zero