diff --git a/firmware/clean.bat b/firmware/clean.bat index f593dfc02a..5d28781f6d 100644 --- a/firmware/clean.bat +++ b/firmware/clean.bat @@ -1,3 +1,8 @@ -echo Entering firmware\clean.bat -rd /s /q .dep -rd /s /q build +@echo off +sh.exe clean.sh || ( + if exist C:\cygwin64 ( + C:\cygwin64\bin\sh.exe clean.sh + ) else ( + if exist C:\cygwin ( C:\cygwin\bin\sh.exe clean.sh ) + ) +) diff --git a/firmware/clean.sh b/firmware/clean.sh new file mode 100644 index 0000000000..09d7d3e0ee --- /dev/null +++ b/firmware/clean.sh @@ -0,0 +1,3 @@ +echo "Entering firmware/clean.bat" +rm -rf .dep +rm -rf build diff --git a/firmware/clean_compile_two_versions.bat b/firmware/clean_compile_two_versions.bat index 82753651af..411ea59a43 100644 --- a/firmware/clean_compile_two_versions.bat +++ b/firmware/clean_compile_two_versions.bat @@ -1,41 +1,8 @@ - -echo Compiler gcc version -arm-none-eabi-gcc -v - -rd /s /q deliver -mkdir deliver - -call clean.bat -echo "TIMESTAMP %date% %time%" -set EXTRA_PARAMS=-DDUMMY -DFIRMWARE_ID=\"default_no_assert\" -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE -make -j4 DEBUG_LEVEL_OPT='-O2' -set EXTRA_PARAMS= - -rem mv build\rusefi.elf deliver\rusefi_no_asserts.elf -mv build\rusefi.bin deliver\rusefi_no_asserts.bin -rem this file is needed for DFU generation -mv build\rusefi.hex deliver\rusefi_no_asserts.hex -echo Release compilation results 1/2 -echo "TIMESTAMP %date% %time%" -ls -l build -if not exist deliver/rusefi_no_asserts.hex echo FAILED to compile NO ASSERTS version -if not exist deliver/rusefi_no_asserts.hex exit -1 - -call clean.bat -echo "TIMESTAMP %date% %time%" -set EXTRA_PARAMS=-DDUMMY -DFIRMWARE_ID=\"default\" -make -j4 -set EXTRA_PARAMS= - -mv build\rusefi.elf deliver\rusefi.elf -rem this file is needed for DFU generation -mv build\rusefi.hex deliver\rusefi.hex -rem Keeping file in place since hw_test.bat would take it from current location -cp build\rusefi.bin deliver\rusefi.bin -echo Debug compilation results 2/2 -echo "TIMESTAMP %date% %time%" -ls -l build -if not exist deliver/rusefi.hex echo FAILED to compile DEFAULT with DEBUG -if not exist deliver/rusefi.hex exit -1 - -echo clean_compile_two_versions: Looks good! +@echo off +sh.exe clean_compile_two_versions.sh || ( + if exist C:\cygwin64 ( + C:\cygwin64\bin\sh.exe clean_compile_two_versions.sh + ) else ( + if exist C:\cygwin ( C:\cygwin\bin\sh.exe clean_compile_two_versions.sh ) + ) +) diff --git a/firmware/clean_compile_two_versions.sh b/firmware/clean_compile_two_versions.sh new file mode 100644 index 0000000000..14595dca4f --- /dev/null +++ b/firmware/clean_compile_two_versions.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +echo "Compiler gcc version" +arm-none-eabi-gcc -v + +rm -rf deliver +mkdir deliver + +sh clean.sh +echo "TIMESTAMP $(date "+%D %T.%2N")" +EXTRA_PARAMS="-DDUMMY -DFIRMWARE_ID=\"default_no_assert\" -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE" +make -j4 DEBUG_LEVEL_OPT='-O2' +EXTRA_PARAMS="" + +# mv build\rusefi.elf deliver\rusefi_no_asserts.elf +mv build\rusefi.bin deliver\rusefi_no_asserts.bin +# this file is needed for DFU generation +mv build\rusefi.hex deliver\rusefi_no_asserts.hex +echo "Release compilation results 1/2" +echo "TIMESTAMP $(date "+%D %T.%2N")" +ls -l build +[ -e deliver/rusefi_no_asserts.hex ] || (echo "FAILED to compile NO ASSERTS version"; exit 1) + +sh clean.sh +echo "TIMESTAMP $(date "+%D %T.%2N")" +EXTRA_PARAMS="-DDUMMY -DFIRMWARE_ID=\"default\"" +make -j4 +EXTRA_PARAMS="" + +mv build\rusefi.elf deliver\rusefi.elf +# this file is needed for DFU generation +mv build\rusefi.hex deliver\rusefi.hex +# Keeping file in place since hw_test.bat would take it from current location +cp build\rusefi.bin deliver\rusefi.bin +echo Debug compilation results 2/2 +echo "TIMESTAMP $(date "+%D %T.%2N")" +ls -l build +[ -e deliver/rusefi.hex ] || (echo "FAILED to compile DEFAULT with DEBUG"; exit 1) + +echo "clean_compile_two_versions: Looks good!" diff --git a/firmware/update_version.bat b/firmware/update_version.bat index eee6bb1b54..ee150599c1 100644 --- a/firmware/update_version.bat +++ b/firmware/update_version.bat @@ -1,6 +1,8 @@ -rem Let's regemerate 'svnversion.h' -rem TODO: handle std err - for example, in case svn needs upgrade - -for /f %%i in ('git rev-parse HEAD') do set git_hash=%%i -echo Git hash=%git_hash% -java -jar ../java_tools/version2header.jar 10000 https://github.com/rusefi/rusefi %git_hash% \ No newline at end of file +@echo off +sh.exe update_version.sh || ( + if exist C:\cygwin64 ( + C:\cygwin64\bin\sh.exe update_version.sh + ) else ( + if exist C:\cygwin ( C:\cygwin\bin\sh.exe update_version.sh ) + ) +) diff --git a/firmware/update_version.sh b/firmware/update_version.sh new file mode 100644 index 0000000000..c36f2ee3d8 --- /dev/null +++ b/firmware/update_version.sh @@ -0,0 +1,6 @@ +# Let's regemerate 'svnversion.h' +# TODO: handle std err - for example, in case svn needs upgrade + +GIT_HASH=$('git rev-parse HEAD') +echo "Git hash=$GIT_HASH" +java -jar ../java_tools/version2header.jar 10000 https://github.com/rusefi/rusefi $GIT_HASH