Skip to content

Commit 194a4cf

Browse files
sjaeckelmrpelotazo
authored andcommitted
helper.pl: add support to update sources.cmake
1 parent d008813 commit 194a4cf

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

helper.pl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,16 @@ sub patch_file {
221221
return $content;
222222
}
223223

224+
sub make_sources_cmake {
225+
my @list = @_;
226+
my $output = "set(SOURCES\n";
227+
foreach my $obj (sort @list) {
228+
$output .= $obj . "\n";
229+
}
230+
$output .= ")\n\nset(HEADERS\ntommath.h\n)\n";
231+
return $output;
232+
}
233+
224234
sub process_makefiles {
225235
my $write = shift;
226236
my $changed_count = 0;
@@ -244,10 +254,12 @@ sub process_makefiles {
244254
}
245255

246256
# update OBJECTS + HEADERS in makefile*
247-
for my $m (qw/ makefile makefile.shared makefile_include.mk makefile.msvc makefile.unix makefile.mingw /) {
257+
for my $m (qw/ makefile makefile.shared makefile_include.mk makefile.msvc makefile.unix makefile.mingw sources.cmake /) {
248258
my $old = read_file($m);
249259
my $new = $m eq 'makefile.msvc' ? patch_file($old, $var_obj)
250-
: patch_file($old, $var_o);
260+
: $m eq 'sources.cmake' ? make_sources_cmake(bsd_glob("*.c"))
261+
: patch_file($old, $var_o);
262+
251263
if ($old ne $new) {
252264
write_file($m, $new) if $write;
253265
warn "changed: $m\n";

sources.cmake

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ mp_complement.c
1616
mp_copy.c
1717
mp_count_bits.c
1818
mp_cutoffs.c
19+
mp_div.c
1920
mp_div_2.c
2021
mp_div_2d.c
21-
mp_div_3.c
22-
mp_div.c
2322
mp_div_d.c
2423
mp_dr_is_modulus.c
2524
mp_dr_reduce.c
2625
mp_dr_setup.c
2726
mp_error_to_string.c
2827
mp_exch.c
28+
mp_expt_n.c
2929
mp_exptmod.c
30-
mp_expt_u32.c
3130
mp_exteuclid.c
3231
mp_fread.c
3332
mp_from_sbin.c
@@ -38,39 +37,35 @@ mp_get_double.c
3837
mp_get_i32.c
3938
mp_get_i64.c
4039
mp_get_l.c
41-
mp_get_ll.c
4240
mp_get_mag_u32.c
4341
mp_get_mag_u64.c
4442
mp_get_mag_ul.c
45-
mp_get_mag_ull.c
4643
mp_grow.c
4744
mp_init.c
4845
mp_init_copy.c
4946
mp_init_i32.c
5047
mp_init_i64.c
5148
mp_init_l.c
52-
mp_init_ll.c
5349
mp_init_multi.c
5450
mp_init_set.c
5551
mp_init_size.c
5652
mp_init_u32.c
5753
mp_init_u64.c
5854
mp_init_ul.c
59-
mp_init_ull.c
6055
mp_invmod.c
6156
mp_is_square.c
6257
mp_kronecker.c
6358
mp_lcm.c
64-
mp_log_u32.c
59+
mp_log_n.c
6560
mp_lshd.c
66-
mp_mod_2d.c
6761
mp_mod.c
62+
mp_mod_2d.c
6863
mp_montgomery_calc_normalization.c
6964
mp_montgomery_reduce.c
7065
mp_montgomery_setup.c
66+
mp_mul.c
7167
mp_mul_2.c
7268
mp_mul_2d.c
73-
mp_mul.c
7469
mp_mul_d.c
7570
mp_mulmod.c
7671
mp_neg.c
@@ -86,32 +81,30 @@ mp_prime_rabin_miller_trials.c
8681
mp_prime_rand.c
8782
mp_prime_strong_lucas_selfridge.c
8883
mp_radix_size.c
84+
mp_radix_size_overestimate.c
8985
mp_rand.c
9086
mp_read_radix.c
87+
mp_reduce.c
9188
mp_reduce_2k.c
9289
mp_reduce_2k_l.c
9390
mp_reduce_2k_setup.c
9491
mp_reduce_2k_setup_l.c
95-
mp_reduce.c
9692
mp_reduce_is_2k.c
9793
mp_reduce_is_2k_l.c
9894
mp_reduce_setup.c
99-
mp_root_u32.c
95+
mp_root_n.c
10096
mp_rshd.c
10197
mp_sbin_size.c
10298
mp_set.c
10399
mp_set_double.c
104100
mp_set_i32.c
105101
mp_set_i64.c
106102
mp_set_l.c
107-
mp_set_ll.c
108103
mp_set_u32.c
109104
mp_set_u64.c
110105
mp_set_ul.c
111-
mp_set_ull.c
112106
mp_shrink.c
113107
mp_signed_rsh.c
114-
mp_sqr.c
115108
mp_sqrmod.c
116109
mp_sqrt.c
117110
mp_sqrtmod_prime.c
@@ -127,6 +120,7 @@ mp_xor.c
127120
mp_zero.c
128121
s_mp_add.c
129122
s_mp_copy_digs.c
123+
s_mp_div_3.c
130124
s_mp_div_recursive.c
131125
s_mp_div_school.c
132126
s_mp_div_small.c
@@ -136,11 +130,11 @@ s_mp_get_bit.c
136130
s_mp_invmod.c
137131
s_mp_invmod_odd.c
138132
s_mp_log.c
133+
s_mp_log_2expt.c
139134
s_mp_log_d.c
140-
s_mp_log_pow2.c
141135
s_mp_montgomery_reduce_comba.c
142-
s_mp_mul_balance.c
143136
s_mp_mul.c
137+
s_mp_mul_balance.c
144138
s_mp_mul_comba.c
145139
s_mp_mul_high.c
146140
s_mp_mul_high_comba.c
@@ -149,6 +143,7 @@ s_mp_mul_toom.c
149143
s_mp_prime_is_divisible.c
150144
s_mp_prime_tab.c
151145
s_mp_radix_map.c
146+
s_mp_radix_size_overestimate.c
152147
s_mp_rand_jenkins.c
153148
s_mp_rand_platform.c
154149
s_mp_sqr.c

0 commit comments

Comments
 (0)