@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
set ROOTDIR=%~dp0\r
set LOGFILE=%ROOTDIR%win_install.log\r
set ERRORFILE=%ROOTDIR%win_install.err\r
-\r
-set GCC4ARM_FILENAME=gcc-arm-none-eabi-4_7-2012q4-20121208-linux.tar.bz2\r
-set GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.7/4.7-2012-q4-major/+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_MD5=%ROOTDIR%build\win32\gcc-arm-none-eabi.md5\r
-set GCC4ARM_VERSION=gcc-arm-none-eabi-4_7-2012q4\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_LIBEXEC=%GCC4ARM_DIR%\lib\gcc\arm-none-eabi\4.7.3\r
-set WINBIN_URL=https://github.com/adamgreen/GCC-ARM-Embedded-20121208/tarball/master\r
-set WINBIN_TAR=%ROOTDIR%GCC-ARM-Embedded-20121208.tar.gz\r
-\r
-set WINBIN_MD5=%ROOTDIR%build\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%build\win32\make.exe\r
set BUILDENV_CMD=%GCC4ARM_BINDIR%\buildenv.cmd\r
set BUILDSHELL_CMD=%ROOTDIR%BuildShell.cmd\r
-set ERROR_ENCOUNTERED=0\r
+set BUILDSHELL_DEBUG_CMD=%ROOTDIR%BuildShellDebug.cmd\r
\r
\r
rem Make sure that we are running with current directory set to where this\r
build\win32\curl -kL0 %GCC4ARM_URL% >%GCC4ARM_TAR%\r
if errorlevel 1 goto ExitOnError\r
\r
-echo Validating md5 signature of Code Sourcery G++ Lite...\r
-call :RunAndLog build\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 build\win32\curl -kL0 %WINBIN_URL%>>%LOGFILE%\r
-build\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 build\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
+del "%GCC4ARM_MD5_FILENAME%"\r
\r
echo Extracting GNU Tools for ARM Embedded Processors...\r
-call :RunAndLog rd /s /q %GCC4ARM_EXTRACT%\r
call :RunAndLog rd /s /q %GCC4ARM_DIR%\r
-call :RunAndLog build\win32\bsdtar xf %GCC4ARM_TAR%\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 build\win32\bsdtar xf %WINBIN_TAR%\r
-for /d %%i in (adamgreen-GCC-ARM-Embedded-*) do call :RunAndLog move %%i %WINBIN_BASEDIR%\r
+call :RunAndLog md %GCC4ARM_DIR%\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 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
+call :RunAndLog cd ..\r
\r
echo Creating helper scripts...\r
echo @echo off>%BUILDENV_CMD%\r
rem\r
echo @cmd.exe /K %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd>%BUILDSHELL_CMD%\r
\r
+rem Place GNU Tool for ARM Embedded Processors in the path before building gcc4mbed code.\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
+if errorlevel 1 goto ExitOnError\r
+call :RunAndLog %OUR_MAKE%\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
-echo To build Smoothie, you will first need to run the following batch\r
+echo To build gcc4mbed samples, you will first need to run the following batch\r
echo file so that your environment variables are set correctly:\r
echo %BUILDSHELL_CMD%\r
echo You will want to run this each time you start a new Command Prompt. You\r
echo can simply double-click on this batch file from Explorer to launch a\r
-echo Command Prompt that has been properly initialized for building.\r
+echo Command Prompt that has been properly initialized for building gcc4mbed\r
+echo based code.\r
echo **************************************************************************\r
\r
rem Restore current directory and exit batch file on success.\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 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
:Exit\r
del %ERRORFILE%\r
popd\r
-pause
\ No newline at end of file
+pause\r