turn off debug printf in httpd
[clinton/Smoothieware.git] / win_install.cmd
... / ...
CommitLineData
1@echo off\r
2rem Copyright 2013 Adam Green (http://mbed.org/users/AdamGreen/)\r
3rem\r
4rem Licensed under the Apache License, Version 2.0 (the "License");\r
5rem you may not use this file except in compliance with the License.\r
6rem You may obtain a copy of the License at\r
7rem\r
8rem http://www.apache.org/licenses/LICENSE-2.0\r
9rem\r
10rem Unless required by applicable law or agreed to in writing, software\r
11rem distributed under the License is distributed on an "AS IS" BASIS,\r
12rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13rem See the License for the specific language governing permissions and\r
14rem limitations under the License.\r
15\r
16\r
17rem Setup batch file specific environment variables.\r
18setlocal\r
19set ROOTDIR=%~dp0\r
20set LOGFILE=%ROOTDIR%win_install.log\r
21set ERRORFILE=%ROOTDIR%win_install.err\r
22set GCC4ARM_VERSION=gcc-arm-none-eabi-4_8-2014q1\r
23set GCC4ARM_FILENAME=gcc-arm-none-eabi-4_8-2014q1-20140314-win32.zip\r
24set GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/%GCC4ARM_FILENAME%\r
25set GCC4ARM_TAR=%ROOTDIR%%GCC4ARM_FILENAME%\r
26set GCC4ARM_MD5=09c19b3248863074f5498a88f31bee16\r
27set GCC4ARM_MD5_FILENAME=%ROOTDIR%gcc-arm-none-eabi.md5\r
28set GCC4ARM_DIR=%ROOTDIR%gcc-arm-none-eabi\r
29set GCC4ARM_BINDIR=%GCC4ARM_DIR%\bin\r
30set OUR_MAKE=%ROOTDIR%build\win32\make.exe\r
31set BUILDENV_CMD=%GCC4ARM_BINDIR%\buildenv.cmd\r
32set BUILDSHELL_CMD=%ROOTDIR%BuildShell.cmd\r
33set BUILDSHELL_DEBUG_CMD=%ROOTDIR%BuildShellDebug.cmd\r
34\r
35\r
36rem Make sure that we are running with current directory set to where this\r
37rem batch file is located.\r
38pushd %ROOTDIR%\r
39\r
40rem Initialize install log files.\r
41echo Logging install results to %LOGFILE%\r
42echo %DATE% %TIME% Starting %0 %*>%LOGFILE%\r
43\r
44echo Downloading GNU Tools for ARM Embedded Processors...\r
45echo %DATE% %TIME% Executing build\win32\curl -kL0 %GCC4ARM_URL%>>%LOGFILE%\r
46build\win32\curl -kL0 %GCC4ARM_URL% >%GCC4ARM_TAR%\r
47if errorlevel 1 goto ExitOnError\r
48\r
49echo Validating md5 signature of GNU Tools for ARM Embedded Processors...\r
50echo %GCC4ARM_MD5% *%GCC4ARM_FILENAME%>%GCC4ARM_MD5_FILENAME%\r
51call :RunAndLog build\win32\md5sum --check %GCC4ARM_MD5_FILENAME%\r
52if errorlevel 1 goto ExitOnError\r
53del "%GCC4ARM_MD5_FILENAME%"\r
54\r
55echo Extracting GNU Tools for ARM Embedded Processors...\r
56call :RunAndLog rd /s /q %GCC4ARM_DIR%\r
57call :RunAndLog md %GCC4ARM_DIR%\r
58if errorlevel 1 goto ExitOnError\r
59call :RunAndLog cd %GCC4ARM_DIR%\r
60call :RunAndLog ..\build\win32\bsdtar xf %GCC4ARM_TAR%\r
61if errorlevel 1 goto ExitOnError\r
62call :RunAndLog cd ..\r
63\r
64echo Creating helper scripts...\r
65echo @echo off>%BUILDENV_CMD%\r
66echo REM Uncomment next line and set destination drive to match mbed device>>%BUILDENV_CMD%\r
67echo REM SET LPC_DEPLOY=copy PROJECT.bin f:\>>%BUILDENV_CMD%\r
68echo.>>%BUILDENV_CMD%\r
69echo SET PATH=%%~dp0;%%~dp0..\..\build\win32;%%PATH%%>>%BUILDENV_CMD%\r
70rem\r
71echo @cmd.exe /K %%~dp0\gcc-arm-none-eabi\bin\buildenv.cmd>%BUILDSHELL_CMD%\r
72\r
73rem Place GNU Tool for ARM Embedded Processors in the path before building gcc4mbed code.\r
74set path=%GCC4ARM_BINDIR%;%ROOTDIR%build\win32;%PATH%\r
75\r
76echo Performing a clean build of the gcc4mbed samples...\r
77call :RunAndLog %OUR_MAKE% clean\r
78if errorlevel 1 goto ExitOnError\r
79call :RunAndLog %OUR_MAKE%\r
80if errorlevel 1 goto ExitOnError\r
81\r
82echo Cleaning up intermediate files...\r
83call :RunAndLog del /f %GCC4ARM_TAR%\r
84\r
85echo **************************************************************************\r
86echo To build gcc4mbed samples, you will first need to run the following batch\r
87echo file so that your environment variables are set correctly:\r
88echo %BUILDSHELL_CMD%\r
89echo You will want to run this each time you start a new Command Prompt. You\r
90echo can simply double-click on this batch file from Explorer to launch a\r
91echo Command Prompt that has been properly initialized for building gcc4mbed\r
92echo based code.\r
93echo **************************************************************************\r
94\r
95rem Restore current directory and exit batch file on success.\r
96echo %DATE% %TIME% Finished successfully>>%LOGFILE%\r
97echo Finished successfully\r
98goto Exit\r
99\r
100\r
101\r
102rem Logs the command to be run and then executes the command while logging the results.\r
103:RunAndLog\r
104echo %DATE% %TIME% Executing %*>>%LOGFILE%\r
105%* 1>>%LOGFILE% 2>%ERRORFILE%\r
106goto :EOF\r
107\r
108\r
109\r
110rem Exits the batch file due to error.\r
111rem Make sure that any stderr text ends up in win_install.log and then restore\r
112rem the current directory before forcing an early exit.\r
113:ExitOnError\r
114type %ERRORFILE% >>%LOGFILE%\r
115echo %DATE% %TIME% Failure forced early exit>>%LOGFILE%\r
116type %LOGFILE%\r
117\r
118\r
119:Exit\r
120del %ERRORFILE%\r
121popd\r
122pause\r