Merge pull request #606 from stv0g/feature/VishayThermistor
[clinton/Smoothieware.git] / win_install.cmd
old mode 100755 (executable)
new mode 100644 (file)
index 6a262f3..edfba5c
@@ -1,5 +1,5 @@
 @echo off\r
 @echo off\r
-rem Copyright 2012 Adam Green (http://mbed.org/users/AdamGreen/)\r
+rem Copyright 2013 Adam Green (http://mbed.org/users/AdamGreen/)\r
 rem\r
 rem Licensed under the Apache License, Version 2.0 (the "License");\r
 rem you may not use this file except in compliance with the License.\r
 rem\r
 rem Licensed under the Apache License, Version 2.0 (the "License");\r
 rem you may not use this file except in compliance with the License.\r
@@ -19,25 +19,18 @@ setlocal
 set ROOTDIR=%~dp0\r
 set LOGFILE=%ROOTDIR%win_install.log\r
 set ERRORFILE=%ROOTDIR%win_install.err\r
 set ROOTDIR=%~dp0\r
 set LOGFILE=%ROOTDIR%win_install.log\r
 set ERRORFILE=%ROOTDIR%win_install.err\r
-set GCC4ARM_FILENAME=gcc-arm-none-eabi-4_6-2012q1-20120316.tar.bz2\r
-set GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.6/4.6-2012-q1-update/+download/%GCC4ARM_FILENAME%\r
+set GCC4ARM_VERSION=gcc-arm-none-eabi-4_8-2014q1\r
+set GCC4ARM_FILENAME=gcc-arm-none-eabi-4_8-2014q1-20140314-win32.zip\r
+set GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/%GCC4ARM_FILENAME%\r
 set GCC4ARM_TAR=%ROOTDIR%%GCC4ARM_FILENAME%\r
 set GCC4ARM_TAR=%ROOTDIR%%GCC4ARM_FILENAME%\r
-set GCC4ARM_MD5=%ROOTDIR%external\win32\gcc-arm-none-eabi.md5\r
-set GCC4ARM_VERSION=gcc-arm-none-eabi-4_6-2012q1\r
-set GCC4ARM_EXTRACT=%ROOTDIR%%GCC4ARM_VERSION%\r
+set GCC4ARM_MD5=09c19b3248863074f5498a88f31bee16\r
+set GCC4ARM_MD5_FILENAME=%ROOTDIR%gcc-arm-none-eabi.md5\r
 set GCC4ARM_DIR=%ROOTDIR%gcc-arm-none-eabi\r
 set GCC4ARM_BINDIR=%GCC4ARM_DIR%\bin\r
 set GCC4ARM_DIR=%ROOTDIR%gcc-arm-none-eabi\r
 set GCC4ARM_BINDIR=%GCC4ARM_DIR%\bin\r
-set GCC4ARM_LIBEXEC=%GCC4ARM_DIR%\libexec\gcc\arm-none-eabi\4.6.2\r
-set WINBIN_URL=https://github.com/adamgreen/GCC-ARM-Embedded-20120316/tarball/master\r
-set WINBIN_TAR=%ROOTDIR%GCC-ARM-Embedded-20120316.tar.gz\r
-set WINBIN_MD5=%ROOTDIR%external\win32\GCC-ARM-Embedded.md5\r
-set WINBIN_BASEDIR=%ROOTDIR%GCC-ARM-Embedded\r
-set WINBIN_DIR=%WINBIN_BASEDIR%\win32\r
-set OUR_MAKE=%ROOTDIR%external\win32\make.exe\r
+set OUR_MAKE=%ROOTDIR%build\win32\make.exe\r
 set BUILDENV_CMD=%GCC4ARM_BINDIR%\buildenv.cmd\r
 set BUILDSHELL_CMD=%ROOTDIR%BuildShell.cmd\r
 set BUILDSHELL_DEBUG_CMD=%ROOTDIR%BuildShellDebug.cmd\r
 set BUILDENV_CMD=%GCC4ARM_BINDIR%\buildenv.cmd\r
 set BUILDSHELL_CMD=%ROOTDIR%BuildShell.cmd\r
 set BUILDSHELL_DEBUG_CMD=%ROOTDIR%BuildShellDebug.cmd\r
-set ERROR_ENCOUNTERED=0\r
 \r
 \r
 rem Make sure that we are running with current directory set to where this\r
 \r
 \r
 rem Make sure that we are running with current directory set to where this\r
@@ -49,59 +42,36 @@ echo Logging install results to %LOGFILE%
 echo %DATE% %TIME%  Starting %0 %*>%LOGFILE%\r
 \r
 echo Downloading GNU Tools for ARM Embedded Processors...\r
 echo %DATE% %TIME%  Starting %0 %*>%LOGFILE%\r
 \r
 echo Downloading GNU Tools for ARM Embedded Processors...\r
-echo %DATE% %TIME%  Executing external\win32\curl -kL0 %GCC4ARM_URL%>>%LOGFILE%\r
-external\win32\curl -kL0 %GCC4ARM_URL% >%GCC4ARM_TAR%\r
+echo %DATE% %TIME%  Executing build\win32\curl -kL0 %GCC4ARM_URL%>>%LOGFILE%\r
+build\win32\curl -kL0 %GCC4ARM_URL% >%GCC4ARM_TAR%\r
 if errorlevel 1 goto ExitOnError\r
 \r
 if errorlevel 1 goto ExitOnError\r
 \r
-echo Validating md5 signature of Code Sourcery G++ Lite...\r
-call :RunAndLog external\win32\md5sum --check %GCC4ARM_MD5%\r
-if errorlevel 1 goto ExitOnError\r
-\r
-echo Downloading Windows GCC binaries from github...\r
-echo %DATE% %TIME%  Executing external\win32\curl -kL0 %WINBIN_URL%>>%LOGFILE%\r
-external\win32\curl -kL0 %WINBIN_URL% >%WINBIN_TAR%\r
-if errorlevel 1 goto ExitOnError\r
-\r
-echo Validating md5 signature of Windows GCC binaries...\r
-call :RunAndLog external\win32\md5sum --check %WINBIN_MD5%\r
+echo Validating md5 signature of GNU Tools for ARM Embedded Processors...\r
+echo %GCC4ARM_MD5% *%GCC4ARM_FILENAME%>%GCC4ARM_MD5_FILENAME%\r
+call :RunAndLog build\win32\md5sum --check %GCC4ARM_MD5_FILENAME%\r
 if errorlevel 1 goto ExitOnError\r
 if errorlevel 1 goto ExitOnError\r
+del "%GCC4ARM_MD5_FILENAME%"\r
 \r
 echo Extracting GNU Tools for ARM Embedded Processors...\r
 call :RunAndLog rd /s /q %GCC4ARM_DIR%\r
 \r
 echo Extracting GNU Tools for ARM Embedded Processors...\r
 call :RunAndLog rd /s /q %GCC4ARM_DIR%\r
-call :RunAndLog external\win32\bsdtar xf %GCC4ARM_TAR%\r
+call :RunAndLog md %GCC4ARM_DIR%\r
 if errorlevel 1 goto ExitOnError\r
 if errorlevel 1 goto ExitOnError\r
-call :RunAndLog move %GCC4ARM_EXTRACT% %GCC4ARM_DIR%\r
-if errorlevel 1 goto ExitOnError\r
-\r
-echo Extracting Windows GCC binaries...\r
-call :RunAndLog rd /s /q %WINBIN_BASEDIR%\r
-call :RunAndLog external\win32\bsdtar xf %WINBIN_TAR%\r
-for /d %%i in (adamgreen-GCC-ARM-Embedded-*) do call :RunAndLog move %%i %WINBIN_BASEDIR%\r
-if errorlevel 1 goto ExitOnError\r
-\r
-echo Installing Windows binaries...\r
-call :RunAndLog del /q %GCC4ARM_BINDIR%\*\r
-call :RunAndLog copy %WINBIN_DIR%\arm-none-eabi-* %GCC4ARM_BINDIR%\\r
-if errorlevel 1 goto ExitOnError\r
-for %%i in (as g++ ld objcopy ranlib ar c++ gcc nm objdump strip) do call :CopyGccFile %%i\r
-if "%ERROR_ENCOUNTERED%"=="1" goto ExitOnError\r
-call :RunAndLog rd /s /q %GCC4ARM_LIBEXEC%\r
-call :RunAndLog xcopy /eiy %WINBIN_DIR%\libexec %GCC4ARM_LIBEXEC%\r
+call :RunAndLog cd %GCC4ARM_DIR%\r
+call :RunAndLog ..\build\win32\bsdtar xf %GCC4ARM_TAR%\r
 if errorlevel 1 goto ExitOnError\r
 if errorlevel 1 goto ExitOnError\r
+call :RunAndLog cd ..\r
 \r
 echo Creating helper scripts...\r
 echo @echo off>%BUILDENV_CMD%\r
 echo REM Uncomment next line and set destination drive to match mbed device>>%BUILDENV_CMD%\r
 echo REM SET LPC_DEPLOY=copy PROJECT.bin f:\>>%BUILDENV_CMD%\r
 echo.>>%BUILDENV_CMD%\r
 \r
 echo Creating helper scripts...\r
 echo @echo off>%BUILDENV_CMD%\r
 echo REM Uncomment next line and set destination drive to match mbed device>>%BUILDENV_CMD%\r
 echo REM SET LPC_DEPLOY=copy PROJECT.bin f:\>>%BUILDENV_CMD%\r
 echo.>>%BUILDENV_CMD%\r
-echo SET PATH=%%~dp0;%%~dp0..\..\external\win32;%%PATH%%>>%BUILDENV_CMD%\r
+echo SET PATH=%%~dp0;%%~dp0..\..\build\win32;%%PATH%%>>%BUILDENV_CMD%\r
 rem\r
 echo @cmd.exe /K %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd>%BUILDSHELL_CMD%\r
 rem\r
 echo @cmd.exe /K %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd>%BUILDSHELL_CMD%\r
-rem\r
-echo @cmd.exe /K "set GCC4MBED_TYPE=Debug& %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd">%BUILDSHELL_DEBUG_CMD%\r
 \r
 rem Place GNU Tool for ARM Embedded Processors in the path before building gcc4mbed code.\r
 \r
 rem Place GNU Tool for ARM Embedded Processors in the path before building gcc4mbed code.\r
-set path=%GCC4ARM_BINDIR%;%ROOTDIR%external\win32;%PATH%\r
+set path=%GCC4ARM_BINDIR%;%ROOTDIR%build\win32;%PATH%\r
 \r
 echo Performing a clean build of the gcc4mbed samples...\r
 call :RunAndLog %OUR_MAKE% clean\r
 \r
 echo Performing a clean build of the gcc4mbed samples...\r
 call :RunAndLog %OUR_MAKE% clean\r
@@ -110,8 +80,6 @@ call :RunAndLog %OUR_MAKE%
 if errorlevel 1 goto ExitOnError\r
 \r
 echo Cleaning up intermediate files...\r
 if errorlevel 1 goto ExitOnError\r
 \r
 echo Cleaning up intermediate files...\r
-call :RunAndLog rd /s /q %WINBIN_BASEDIR%\r
-call :RunAndLog del /f %WINBIN_TAR%\r
 call :RunAndLog del /f %GCC4ARM_TAR%\r
 \r
 echo **************************************************************************\r
 call :RunAndLog del /f %GCC4ARM_TAR%\r
 \r
 echo **************************************************************************\r
@@ -139,17 +107,9 @@ goto :EOF
 \r
 \r
 \r
 \r
 \r
 \r
-rem Copies a file between GCC directories where one has arm-none-eabi prefix and the other doesn't\r
-:CopyGccFile\r
-call :RunAndLog del "%GCC4ARM_DIR%\arm-none-eabi\bin\%1"\r
-call :RunAndLog copy /y "%GCC4ARM_BINDIR%\arm-none-eabi-%1.exe" "%GCC4ARM_DIR%\arm-none-eabi\bin\%1.exe"\r
-if errorlevel 1 set ERROR_ENCOUNTERED=1\r
-goto :EOF\r
-\r
-\r
 rem Exits the batch file due to error.\r
 rem Exits the batch file due to error.\r
-rem Make sure that any stderr text ends up in win_install.log and the restore\r
-rem the current dictory before forcing an early exit.\r
+rem Make sure that any stderr text ends up in win_install.log and then restore\r
+rem the current directory before forcing an early exit.\r
 :ExitOnError\r
 type %ERRORFILE% >>%LOGFILE%\r
 echo %DATE% %TIME%  Failure forced early exit>>%LOGFILE%\r
 :ExitOnError\r
 type %ERRORFILE% >>%LOGFILE%\r
 echo %DATE% %TIME%  Failure forced early exit>>%LOGFILE%\r
@@ -159,4 +119,4 @@ type %LOGFILE%
 :Exit\r
 del %ERRORFILE%\r
 popd\r
 :Exit\r
 del %ERRORFILE%\r
 popd\r
-pause
\ No newline at end of file
+pause\r