diff --git a/Makefile b/Makefile index 77b7b9741..02fbe820b 100644 --- a/Makefile +++ b/Makefile @@ -312,7 +312,7 @@ release: # - Tagging temporarily... @git tag -a -m "Release $(VERSION) - $(RELEASE_NAME)" $(VERSION) # - Changing default version information based on new tag - @$(SH) tools/mkversion.sh > common/default_version.c.tmp && $(MV) common/default_version.c.tmp common/default_version.c + @$(SH) tools/mkversion.sh > common/default_version_pm3.c.tmp && $(MV) common/default_version_pm3.c.tmp common/default_version_pm3.c # - Removing mkversion calls @sed -i 's#^.*\.\./tools/mkversion.sh.*|| #\t$$(Q)#' client/Makefile bootrom/Makefile armsrc/Makefile @sed -i '/COMMAND/s/sh .*|| //' client/CMakeLists.txt diff --git a/armsrc/Makefile b/armsrc/Makefile index 019d10820..233af73e2 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -140,7 +140,7 @@ ARMSRC = fpgaloader.c \ usb_cdc.c \ cmd.c -VERSIONSRC = version.c \ +VERSIONSRC = version_pm3.c \ fpga_version_info.c # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC @@ -163,8 +163,8 @@ showinfo: .DELETE_ON_ERROR: -# version.c should be remade on every time fullimage.stage1.elf should be remade -version.c: default_version.c $(OBJDIR)/fpga_version_info.o $(OBJDIR)/fpga_all.o $(THUMBOBJ) $(ARMOBJ) +# 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) $< $@ @@ -237,7 +237,7 @@ clean: $(Q)$(RM) $(OBJDIR)$(PATHSEP)*.d $(Q)$(RM) $(OBJDIR)$(PATHSEP)*.z $(Q)$(RM) $(OBJDIR)$(PATHSEP)*.bin - $(Q)$(RM) version.c + $(Q)$(RM) version_pm3.c version.c install: all $(info [@] Installing fullimage to $(DESTDIR)$(PREFIX)...) diff --git a/bootrom/Makefile b/bootrom/Makefile index 9a0359d2f..255ebeb1c 100644 --- a/bootrom/Makefile +++ b/bootrom/Makefile @@ -13,7 +13,7 @@ THUMBSRC = usb_cdc.c \ bootrom.c ASMSRC = ram-reset.s flash-reset.s -VERSIONSRC = version.c +VERSIONSRC = version_pm3.c ## There is a strange bug with the linker: Sometimes it will not emit the glue to call ## BootROM from ARM mode. The symbol is emitted, but the section will be filled with @@ -36,8 +36,8 @@ INSTALLFW = $(OBJDIR)/bootrom.elf OBJS = $(OBJDIR)/bootrom.s19 -# version.c should be remade on every compilation -version.c: default_version.c +# version_pm3.c should be remade on every compilation +version_pm3.c: default_version_pm3.c $(info [=] GEN $@) $(Q)$(SH) ../tools/mkversion.sh > $@ || $(PERL) ../tools/mkversion.pl > $@ || $(CP) $< $@ @@ -60,7 +60,7 @@ clean: $(Q)$(RM) $(OBJDIR)$(PATHSEP)*.s19 $(Q)$(RM) $(OBJDIR)$(PATHSEP)*.map $(Q)$(RM) $(OBJDIR)$(PATHSEP)*.d - $(Q)$(RM) version.c + $(Q)$(RM) version_pm3.c version.c install: all $(info [@] Installing bootrom to $(DESTDIR)$(PREFIX)...) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index dc56ac9b2..6ceef796e 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -314,13 +314,13 @@ set (TARGET_SOURCES ${PM3_ROOT}/client/src/util.c ${PM3_ROOT}/client/src/wiegand_formats.c ${PM3_ROOT}/client/src/wiegand_formatutils.c - ${CMAKE_BINARY_DIR}/version.c + ${CMAKE_BINARY_DIR}/version_pm3.c ) add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/version.c - COMMAND sh ${PM3_ROOT}/tools/mkversion.sh > ${CMAKE_BINARY_DIR}/version.c || perl ${PM3_ROOT}/tools/mkversion.pl > ${CMAKE_BINARY_DIR}/version.c || ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version.c ${CMAKE_BINARY_DIR}/version.c - DEPENDS ${PM3_ROOT}/common/default_version.c + 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 + DEPENDS ${PM3_ROOT}/common/default_version_pm3.c ) set(ADDITIONAL_SRC "") diff --git a/client/Makefile b/client/Makefile index 31e7e68ba..e5ed43548 100644 --- a/client/Makefile +++ b/client/Makefile @@ -582,7 +582,7 @@ SRCS = aiddesfire.c \ tea.c \ ui.c \ util.c \ - version.c \ + version_pm3.c \ wiegand_formats.c \ wiegand_formatutils.c @@ -631,7 +631,7 @@ OBJS += $(OBJCSRCS:%.m=$(OBJDIR)/%.o) BINS = proxmark3 -CLEAN = $(BINS) src/version.c src/*.moc.cpp src/ui/ui_overlays.h lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua +CLEAN = $(BINS) src/version_pm3.c src/*.moc.cpp src/ui/ui_overlays.h lualibs/pm3_cmd.lua lualibs/mfc_default_keys.lua # transition: cleaning also old path stuff CLEAN += flasher *.moc.cpp ui/ui_overlays.h @@ -771,8 +771,8 @@ src/pm3_pywrap.c: pm3.i .PHONY: all clean install uninstall tarbin .FORCE -# version.c should be remade on every compilation -src/version.c: default_version.c +# version_pm3.c should be remade on every compilation +src/version_pm3.c: default_version_pm3.c $(info [=] GEN $@) $(Q)$(SH) ../tools/mkversion.sh > $@ || $(PERL) ../tools/mkversion.pl > $@ || $(CP) $< $@ diff --git a/client/experimental_lib/CMakeLists.txt b/client/experimental_lib/CMakeLists.txt index b2ac8591c..1aeea30e2 100644 --- a/client/experimental_lib/CMakeLists.txt +++ b/client/experimental_lib/CMakeLists.txt @@ -313,13 +313,13 @@ set (TARGET_SOURCES ${PM3_ROOT}/client/src/util.c ${PM3_ROOT}/client/src/wiegand_formats.c ${PM3_ROOT}/client/src/wiegand_formatutils.c - ${CMAKE_BINARY_DIR}/version.c + ${CMAKE_BINARY_DIR}/version_pm3.c ) add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/version.c - COMMAND sh ${PM3_ROOT}/tools/mkversion.sh > ${CMAKE_BINARY_DIR}/version.c || perl ${PM3_ROOT}/tools/mkversion.pl > ${CMAKE_BINARY_DIR}/version.c || ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version.c ${CMAKE_BINARY_DIR}/version.c - DEPENDS ${PM3_ROOT}/common/default_version.c + 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 + DEPENDS ${PM3_ROOT}/common/default_version_pm3.c ) set(ADDITIONAL_SRC "") diff --git a/common/default_version.c b/common/default_version_pm3.c similarity index 77% rename from common/default_version.c rename to common/default_version_pm3.c index 0f42590e8..8547182dc 100644 --- a/common/default_version.c +++ b/common/default_version_pm3.c @@ -1,5 +1,5 @@ #include "common.h" -/* This is the default version.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 neither sh nor perl are available */ #ifndef ON_DEVICE #define SECTVERSINFO #else diff --git a/tools/mkversion.pl b/tools/mkversion.pl index ea3b9940a..cba8fb298 100755 --- a/tools/mkversion.pl +++ b/tools/mkversion.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -w -# Output a version.c file that includes information about the current build +# 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 @@ -23,7 +23,7 @@ my $undecided = (defined $ARGV[0]) && ($ARGV[0] =~ '--undecided'); ####### # solves some bug on macos i.e: ## -# perl ../tools/mkversion.pl .. > version.c || cp ../common/default_version.c version.c +# 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. ## diff --git a/tools/mkversion.sh b/tools/mkversion.sh index 850ef2101..4569a7cf4 100755 --- a/tools/mkversion.sh +++ b/tools/mkversion.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Output a version.c file that includes information about the current build +# Output a version_pm3.c file that includes information about the current build # From mkversion.pl # pure sh POSIX as now even on Windows we use WSL or ProxSpace with sh available