diff --git a/armsrc/Makefile b/armsrc/Makefile index 968dc445d..bd311bebc 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -184,7 +184,7 @@ showinfo: # version_pm3.c should be remade on every time fullimage.stage1.elf should be remade version_pm3.c: default_version_pm3.c $(OBJDIR)/fpga_version_info.o $(OBJDIR)/fpga_all.o $(THUMBOBJ) $(ARMOBJ) $(info [-] GEN $@) - $(Q)$(SH) ../tools/mkversion.sh > $@ || $(PERL) ../tools/mkversion.pl > $@ || $(CP) $< $@ + $(Q)$(SH) ../tools/mkversion.sh > $@ || $(CP) $< $@ fpga_version_info.c: $(FPGA_BITSTREAMS) $(FPGA_COMPRESSOR) $(info [-] GEN $@) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index f6a0c9e9f..4c5e834a1 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -358,7 +358,7 @@ set (TARGET_SOURCES add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/version_pm3.c - COMMAND sh ${PM3_ROOT}/tools/mkversion.sh > ${CMAKE_BINARY_DIR}/version_pm3.c || perl ${PM3_ROOT}/tools/mkversion.pl > ${CMAKE_BINARY_DIR}/version_pm3.c || ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version_pm3.c ${CMAKE_BINARY_DIR}/version_pm3.c + COMMAND sh ${PM3_ROOT}/tools/mkversion.sh > ${CMAKE_BINARY_DIR}/version_pm3.c || ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version_pm3.c ${CMAKE_BINARY_DIR}/version_pm3.c DEPENDS ${PM3_ROOT}/common/default_version_pm3.c ) diff --git a/client/Makefile b/client/Makefile index 4debb130f..a93ab5409 100644 --- a/client/Makefile +++ b/client/Makefile @@ -881,9 +881,9 @@ src/pm3_pywrap.c: pm3.i .PHONY: all clean install uninstall tarbin .FORCE # version_pm3.c should be remade on every compilation -src/version_pm3.c: default_version_pm3.c +src/version_pm3.c: .FORCE default_version_pm3.c $(info [=] GEN $@) - $(Q)$(SH) ../tools/mkversion.sh > $@ || $(PERL) ../tools/mkversion.pl > $@ || $(CP) $< $@ + $(Q)$(SH) ../tools/mkversion.sh > $@ || $(CP) $< $@ # easy printing of MAKE VARIABLES print-%: ; @echo $* = $($*) diff --git a/client/experimental_lib/CMakeLists.txt b/client/experimental_lib/CMakeLists.txt index 618b5af28..e82f73953 100644 --- a/client/experimental_lib/CMakeLists.txt +++ b/client/experimental_lib/CMakeLists.txt @@ -359,7 +359,7 @@ set (TARGET_SOURCES add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/version_pm3.c - COMMAND sh ${PM3_ROOT}/tools/mkversion.sh > ${CMAKE_BINARY_DIR}/version_pm3.c || perl ${PM3_ROOT}/tools/mkversion.pl > ${CMAKE_BINARY_DIR}/version_pm3.c || ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version_pm3.c ${CMAKE_BINARY_DIR}/version_pm3.c + COMMAND sh ${PM3_ROOT}/tools/mkversion.sh > ${CMAKE_BINARY_DIR}/version_pm3.c || ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version_pm3.c ${CMAKE_BINARY_DIR}/version_pm3.c DEPENDS ${PM3_ROOT}/common/default_version_pm3.c ) diff --git a/common/default_version_pm3.c b/common/default_version_pm3.c index d2a1deb83..46eac57c9 100644 --- a/common/default_version_pm3.c +++ b/common/default_version_pm3.c @@ -14,7 +14,7 @@ // See LICENSE.txt for the text of the license. //----------------------------------------------------------------------------- #include "common.h" -/* This is the default version_pm3.c file that Makefile.common falls back to if neither sh nor perl are available */ +/* This is the default version_pm3.c file that Makefile.common falls back to if sh is not available */ #ifndef ON_DEVICE #define SECTVERSINFO #else diff --git a/tools/mkversion.pl b/tools/mkversion.pl deleted file mode 100755 index 9f47a355b..000000000 --- a/tools/mkversion.pl +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/perl -w - -# Output a version_pm3.c file that includes information about the current build -# Normally a couple of lines of bash would be enough (see openpcd project, original firmware by Harald Welte and Milosch Meriac) -# but this will, at least in theory, also work on Windows with our current compile environment. -# -- Henryk Plötz 2009-09-28 -# Modified april 2014 because of the move to github. -# --- Martin Holst Swende -# Modified january 2016 to work with Travis-CI -# --- iceman - -# Clear environment locale so that git will not use localized strings -$ENV{'LC_ALL'} = "C"; -$ENV{'LANG'} = "C"; - -# if you are making your own fork, change this line to reflect your fork-name -my $fullgitinfo = 'RRG/Iceman'; -my $ctime; -# GIT status 0 = dirty, 1 = clean , 2 = undecided -my $clean = 2; -my $undecided = (defined $ARGV[0]) && ($ARGV[0] =~ '--undecided'); -# Do we have access to git command? -####### -# solves some bug on macos i.e: -## -# perl ../tools/mkversion.pl .. > version_pm3.c || cp ../common/default_version_pm3.c version_pm3.c -# /usr/bin/which: /usr/bin/which: cannot execute binary file -# fatal: No names found, cannot describe anything. -## -# anyway forcing any kind of shell is at least useless, at worst fatal. -my $commandGIT = "env which git"; - -if ( defined($commandGIT) ) { - - # this goes on Internet and cause major slowdowns on poor connections or intranets, let's comment it - #my $githistory = `git fetch --all`; - # now avoiding the "fatal: No names found, cannot describe anything." error by fallbacking to abbrev hash in such case - my $gitversion = `git describe --dirty --always`; - my $gitbranch = `git rev-parse --abbrev-ref HEAD`; - if (not $undecided) { - $clean = $gitversion =~ '-dirty' ? 0 : 1; - } - if ( defined($gitbranch) and defined($gitversion) ) { - $fullgitinfo = $fullgitinfo.'/'. $gitbranch . '/' . $gitversion; - - my @compiletime = localtime(); - $compiletime[4] += 1; - $compiletime[5] += 1900; - $ctime = sprintf("%6\$04i-%5\$02i-%4\$02i %3\$02i:%2\$02i:%1\$02i", @compiletime); - } else { - $fullgitinfo = $fullgitinfo.'/master/release (git)'; - } -} else { - $fullgitinfo = $fullgitinfo.'/master/release (no_git)'; - my @dl_time = localtime( (stat('../README.md'))[10] ); - $dl_time[4] += 1; - $dl_time[5] += 1900; - $ctime = sprintf("%6\$04i-%5\$02i-%4\$02i %3\$02i:%2\$02i:%1\$02i", @dl_time); -} - -$fullgitinfo =~ s/(\s)//g; - -# Crop so it fits within 50 characters -#$fullgitinfo =~ s/.{50}\K.*//s; -$fullgitinfo = substr $fullgitinfo, 0, 49; - -print <