Skip to content

Commit

Permalink
update VERSION variables in makefiles
Browse files Browse the repository at this point in the history
VERSION is now VERSION_PC
the new VERSION contains the entire string of SCRYPT
  • Loading branch information
sjaeckel committed Jul 5, 2017
1 parent a8965f0 commit e53858c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions helper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ sub patch_makefile {
return $content;
}

sub version_form_tomcrypt_h {
sub version_from_tomcrypt_h {
my $h = read_file(shift);
if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+).*"/s) {
return "VERSION=$1.$2.$3", "VERSION_LT=0:$1$2";
if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) {
return "VERSION_PC=$1.$2.$3", "VERSION_LT=0:$1$2", "VERSION=$1.$2.$3$4";
}
else {
die "#define SCRYPT not found in tomcrypt.h";
Expand All @@ -304,7 +304,7 @@ sub process_makefiles {
my $var_to = prepare_variable("TOBJECTS", sort map { my $x = $_; $x =~ s/\.c$/.o/; $x } @t);
(my $var_tobj = $var_to) =~ s/\.o\b/.obj/sg;

my @ver_version = version_form_tomcrypt_h("src/headers/tomcrypt.h");
my @ver_version = version_from_tomcrypt_h("src/headers/tomcrypt.h");

# update MSVC project files
my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64']);
Expand Down
2 changes: 1 addition & 1 deletion makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ EXTRALIBS = -L../libtommath -ltommath
#Compilation flags
LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
VERSION=1.18.0
VERSION=1.18.0-rc1

#Libraries to be created
LIBMAIN_S =libtomcrypt.a
Expand Down
2 changes: 1 addition & 1 deletion makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ EXTRALIBS = ../libtommath/tommath.lib
#Compilation flags
LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3
LTC_LDFLAGS = advapi32.lib $(EXTRALIBS)
VERSION=1.18.0
VERSION=1.18.0-rc1

#Libraries to be created (this makefile builds only static libraries)
LIBMAIN_S =tomcrypt.lib
Expand Down
2 changes: 1 addition & 1 deletion makefile.shared
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $(LIBNAME): $(OBJECTS)
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `find ./src -type f -name "*.lo" | LC_ALL=C sort` $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT)

install: .common_install
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > libtomcrypt.pc
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc
install -d $(DESTDIR)$(LIBPATH)/pkgconfig
install -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/

Expand Down
2 changes: 1 addition & 1 deletion makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ EXTRALIBS = ../libtommath/libtommath.a
#Compilation flags
LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
VERSION=1.18.0
VERSION=1.18.0-rc1

#Libraries to be created (this makefile builds only static libraries)
LIBMAIN_S =libtomcrypt.a
Expand Down
5 changes: 3 additions & 2 deletions makefile_include.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Include makefile used by makefile + makefile.shared
# (GNU make only)

# The version - BEWARE: VERSION and VERSION_LT are updated via ./updatemakes.sh
VERSION=1.18.0
# The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh
VERSION=1.18.0-rc1
VERSION_PC=1.18.0
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
VERSION_LT=0:118

Expand Down

0 comments on commit e53858c

Please sign in to comment.