also patch doc/Doxyfile automatically
This commit is contained in:
parent
62143d96bd
commit
b3c9f586dc
12
helper.pl
12
helper.pl
@ -260,7 +260,7 @@ sub prepare_msvc_files_xml {
|
|||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub patch_makefile {
|
sub patch_file {
|
||||||
my ($content, @variables) = @_;
|
my ($content, @variables) = @_;
|
||||||
for my $v (@variables) {
|
for my $v (@variables) {
|
||||||
if ($v =~ /^([A-Z0-9_]+)\s*=.*$/si) {
|
if ($v =~ /^([A-Z0-9_]+)\s*=.*$/si) {
|
||||||
@ -268,7 +268,7 @@ sub patch_makefile {
|
|||||||
$content =~ s/\n\Q$name\E\b.*?[^\\]\n/\n$v\n/s;
|
$content =~ s/\n\Q$name\E\b.*?[^\\]\n/\n$v\n/s;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
die "patch_makefile failed: " . substr($v, 0, 30) . "..";
|
die "patch_file failed: " . substr($v, 0, 30) . "..";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $content;
|
return $content;
|
||||||
@ -277,7 +277,7 @@ sub patch_makefile {
|
|||||||
sub version_from_tomcrypt_h {
|
sub version_from_tomcrypt_h {
|
||||||
my $h = read_file(shift);
|
my $h = read_file(shift);
|
||||||
if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) {
|
if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) {
|
||||||
return "VERSION_PC=$1.$2.$3", "VERSION_LT=1:0", "VERSION=$1.$2.$3$4";
|
return "VERSION_PC=$1.$2.$3", "VERSION_LT=1:0", "VERSION=$1.$2.$3$4", "PROJECT_NUMBER=$1.$2.$3$4";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
die "#define SCRYPT not found in tomcrypt.h";
|
die "#define SCRYPT not found in tomcrypt.h";
|
||||||
@ -320,10 +320,10 @@ sub process_makefiles {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# update OBJECTS + HEADERS in makefile*
|
# update OBJECTS + HEADERS in makefile*
|
||||||
for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile_include.mk /) {
|
for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile_include.mk doc\/Doxyfile /) {
|
||||||
my $old = read_file($m);
|
my $old = read_file($m);
|
||||||
my $new = $m eq 'makefile.msvc' ? patch_makefile($old, $var_obj, $var_h, $var_tobj, @ver_version)
|
my $new = $m eq 'makefile.msvc' ? patch_file($old, $var_obj, $var_h, $var_tobj, @ver_version)
|
||||||
: patch_makefile($old, $var_o, $var_h, $var_to, @ver_version);
|
: patch_file($old, $var_o, $var_h, $var_to, @ver_version);
|
||||||
if ($old ne $new) {
|
if ($old ne $new) {
|
||||||
write_file($m, $new) if $write;
|
write_file($m, $new) if $write;
|
||||||
warn "changed: $m\n";
|
warn "changed: $m\n";
|
||||||
|
@ -6,7 +6,7 @@ makefiles=(makefile makefile_include.mk makefile.shared makefile.unix makefile.m
|
|||||||
vcproj=(libtomcrypt_VS2008.vcproj)
|
vcproj=(libtomcrypt_VS2008.vcproj)
|
||||||
|
|
||||||
if [ $# -eq 1 ] && [ "$1" == "-c" ]; then
|
if [ $# -eq 1 ] && [ "$1" == "-c" ]; then
|
||||||
git add ${makefiles[@]} ${vcproj[@]} && git commit -m 'Update makefiles'
|
git add ${makefiles[@]} ${vcproj[@]} doc/Doxyfile && git commit -m 'Update makefiles'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user