From e53858c7402de08b0480a84a44886077a23a6f64 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 5 Jul 2017 13:57:13 +0200 Subject: [PATCH] update VERSION variables in makefiles VERSION is now VERSION_PC the new VERSION contains the entire string of SCRYPT --- helper.pl | 8 ++++---- makefile.mingw | 2 +- makefile.msvc | 2 +- makefile.shared | 2 +- makefile.unix | 2 +- makefile_include.mk | 5 +++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/helper.pl b/helper.pl index 34eca0dc7..e8e9fc7b6 100755 --- a/helper.pl +++ b/helper.pl @@ -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"; @@ -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']); diff --git a/makefile.mingw b/makefile.mingw index 67de35032..021335898 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -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 diff --git a/makefile.msvc b/makefile.msvc index 1c8700585..be1988aea 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -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 diff --git a/makefile.shared b/makefile.shared index 3efde7bae..0a69bf923 100644 --- a/makefile.shared +++ b/makefile.shared @@ -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/ diff --git a/makefile.unix b/makefile.unix index 870f75152..39722e820 100644 --- a/makefile.unix +++ b/makefile.unix @@ -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 diff --git a/makefile_include.mk b/makefile_include.mk index afe51094c..6fce58292 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -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