1 @setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
4 set REPORT_NAME=Win_Check_Output.txt
6 :: -----------------------------------------------------------------------------
10 echo QMK Windows Check Output %BAT_VERSION%
11 echo QMK Windows Check Output %BAT_VERSION%.>%REPORT_NAME%
13 :: -----------------------------------------------------------------------------
15 set MINGW_BASE_DIR=C:\MinGW
18 set KEYMAP_CLEAN=atomic-pvc-clean
20 :: -----------------------------------------------------------------------------
22 if /I "%1" EQU VERBOSE (goto :Verbose_Make) else (goto :Normal_Make)
25 set MAKE_CMD_LEVEL_0=make -r -f Makefile COLOR=FALSE
26 set MAKE_CMD_LEVEL_1=make -r -f ../Makefile COLOR=FALSE
27 set MAKE_CMD_LEVEL_2=make -r -f ../../Makefile COLOR=FALSE
32 set MAKE_CMD_LEVEL_0=make -r -d -f Makefile COLOR=FALSE VERBOSE=TRUE
33 set MAKE_CMD_LEVEL_1=make -r -d -f ../Makefile COLOR=FALSE VERBOSE=TRUE
34 set MAKE_CMD_LEVEL_2=make -r -d -f ../../Makefile COLOR=FALSE VERBOSE=TRUE
40 :: -----------------------------------------------------------------------------
42 set HEADER=CURRENT DIRECTORY & call :ReportHeader
44 echo %CD%>>%REPORT_NAME% 2>&1
46 echo.>>%REPORT_NAME% 2>&1
48 :: -----------------------------------------------------------------------------
50 set HEADER=CURRENT PATHS & call :ReportHeader
52 for %%A in ("%path:;=";"%") do (echo %%~A>>%REPORT_NAME% 2>&1)
54 echo.>>%REPORT_NAME% 2>&1
56 :: -----------------------------------------------------------------------------
58 rem set HEADER=CURRENT ENVIRONMENTAL SETTINGS & call :ReportHeader
60 rem set>>%REPORT_NAME% 2>&1
61 rem echo.>>%REPORT_NAME% 2>&1
63 :: -----------------------------------------------------------------------------
65 set HEADER=KEY EXECUTABLE LOCATIONS - GENERAL & call :ReportHeader
67 set FILENAME=make.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU Make" & call :ReportVersion
68 set FILENAME=git.exe & set VERSION_CMD=--version & set VERSION_FIND="git" & call :ReportVersion
69 set FILENAME=cmp.exe & set VERSION_CMD=--version & set VERSION_FIND="cmp" & call :ReportVersion
71 :: -----------------------------------------------------------------------------
73 set HEADER=EXECUTABLE LOCATIONS - AVR MCU COMPILERS & call :ReportHeader
75 set FILENAME=avr-gcc.exe & set VERSION_CMD=--version & set VERSION_FIND="avr" & call :ReportVersion
76 set FILENAME=avr-objcopy.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU objcopy" & call :ReportVersion
77 set FILENAME=avr-objdump.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU objdump" & call :ReportVersion
78 set FILENAME=avr-size.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU size" & call :ReportVersion
79 set FILENAME=avr-ar.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU ar" & call :ReportVersion
80 set FILENAME=avr-nm.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU nm" & call :ReportVersion
82 :: -----------------------------------------------------------------------------
84 set HEADER=EXECUTABLE LOCATIONS - ARM MCU COMPILERS & call :ReportHeader
86 set FILENAME=arm-none-eabi-gcc.exe & set VERSION_CMD=--version & set VERSION_FIND="arm-none-eabi-gcc" & call :ReportVersion
87 set FILENAME=arm-none-eabi-objcopy.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU objcopy" & call :ReportVersion
88 set FILENAME=arm-none-eabi-objdump.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU objdump" & call :ReportVersion
89 set FILENAME=arm-none-eabi-size.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU size" & call :ReportVersion
90 set FILENAME=arm-none-eabi-ar.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU ar" & call :ReportVersion
91 set FILENAME=arm-none-eabi-nm.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU nm" & call :ReportVersion
93 :: -----------------------------------------------------------------------------
95 set HEADER=EXECUTABLE LOCATIONS - NATIVE COMPILERS & call :ReportHeader
97 set FILENAME=gcc.exe & set VERSION_CMD=--version & set VERSION_FIND="gcc" & call :ReportVersion
98 set FILENAME=objcopy.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU objcopy" & call :ReportVersion
99 set FILENAME=objdump.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU objdump" & call :ReportVersion
100 set FILENAME=size.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU size" & call :ReportVersion
101 set FILENAME=ar.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU ar" & call :ReportVersion
102 set FILENAME=nm.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU nm" & call :ReportVersion
104 :: -----------------------------------------------------------------------------
106 set HEADER=EXECUTABLE LOCATIONS - PROGRAMMERS & call :ReportHeader
108 set FILENAME=dfu-programmer.exe & set VERSION_CMD=--version & set VERSION_FIND="dfu" & call :ReportVersion
109 set FILENAME=batchisp.exe & set VERSION_CMD=-version & set VERSION_FIND="batchisp" & call :ReportVersion
110 set FILENAME=dfu-util.exe & call :Report
111 set FILENAME=teensy_loader_cli.exe & call :Report
112 set FILENAME=hid_bootloader_cli.exe & call :Report
113 set FILENAME=avrdude.exe & call :Report
115 :: -----------------------------------------------------------------------------
117 set HEADER=EXECUTABLE LOCATIONS - OPTIONAL & call :ReportHeader
118 set FILENAME=cppcheck.exe & call :Report
119 set FILENAME=doxygen.exe & call :Report
120 set FILENAME=gdb-config.exe & call :Report
121 set FILENAME=wget.exe & call :Report
122 set FILENAME=unzip.exe & call :Report
124 :: -----------------------------------------------------------------------------
126 set HEADER=MINGW CHECK - OPTIONAL & call :ReportHeader
127 if exist %MINGW_BASE_DIR% (echo Expected MinGW Base Dir = %MINGW_BASE_DIR%>>%REPORT_NAME% 2>&1) else (echo Expected MinGW Base Dir = %MINGW_BASE_DIR% - Not Found>>%REPORT_NAME% 2>&1)
128 echo.>>%REPORT_NAME% 2>&1
129 set FILENAME=mingw32-make.exe & set VERSION_CMD=--version & set VERSION_FIND="GNU Make" & call :ReportVersion
130 if exist %MINGW_BASE_DIR%\bin\make.exe (ECHO It is not recommended to have make.exe in mingw/bin.>>%REPORT_NAME% 2>&1 & echo.>>%REPORT_NAME% 2>&1)
132 :: -----------------------------------------------------------------------------
134 set HEADER=MAKE CHECK & call :ReportHeader
135 if exist Makefile (set MAKE_CMD=%MAKE_CMD_LEVEL_0% & goto MakeFound)
136 if exist ..\Makefile (set MAKE_CMD=%MAKE_CMD_LEVEL_1% & goto MakeFound)
137 if exist ..\..\Makefile (set MAKE_CMD=%MAKE_CMD_LEVEL_2% & goto MakeFound)
139 echo No Makfile Found.>>%REPORT_NAME% 2>&1
140 echo.>>%REPORT_NAME% 2>&1
141 echo ------------------------------------------------------------------------->>%REPORT_NAME% 2>&1
143 goto :ContinueAfterMake
154 rem type %REPORT_NAME%
156 echo See %REPORT_NAME% for the report.
160 :: -----------------------------------------------------------------------------
164 echo Makfile Found.>>%REPORT_NAME% 2>&1
165 echo.>>%REPORT_NAME% 2>&1
166 set HEADER=MAKE CLEAN & call :ReportHeader
167 echo Make Command = %MAKE_CMD% %KEYMAP_CLEAN%>>%REPORT_NAME% 2>&1
168 echo.>>%REPORT_NAME% 2>&1
169 %MAKE_CMD% %KEYMAP_CLEAN%>>%REPORT_NAME% 2>&1
170 set HEADER=MAKE & call :ReportHeader
171 echo Make Command = %MAKE_CMD% %KEYMAP%>>%REPORT_NAME% 2>&1
172 echo.>>%REPORT_NAME% 2>&1
173 %MAKE_CMD% %KEYMAP%>>%REPORT_NAME% 2>&1
174 echo ------------------------------------------------------------------------->>%REPORT_NAME% 2>&1
175 echo.>>%REPORT_NAME% 2>&1
179 echo ------------------------------------------------------------------------->>%REPORT_NAME% 2>&1
180 echo.>>%REPORT_NAME% 2>&1
181 echo %HEADER%>>%REPORT_NAME% 2>&1
182 echo.>>%REPORT_NAME% 2>&1
186 echo Filename = %FILENAME% >>%REPORT_NAME% 2>&1
187 <nul set /p output="Location = " >>%REPORT_NAME% 2>&1
188 where %FILENAME% >>%REPORT_NAME% 2> NUL
189 if ERRORLEVEL 1 (echo Not Found >>%REPORT_NAME% 2>&1 & goto :EndReport)
192 echo.>>%REPORT_NAME% 2>&1
193 <nul set /p output="."
197 echo Filename = %FILENAME% >>%REPORT_NAME% 2>&1
198 <nul set /p output="Location = " >>%REPORT_NAME% 2>&1
199 where %FILENAME% >>%REPORT_NAME% 2> NUL
200 if ERRORLEVEL 1 (echo Not Found >>%REPORT_NAME% 2>&1 & goto :EndReportVersion)
201 <nul set /p output ="Version = " >>%REPORT_NAME% 2>&1
203 (%FILENAME% %VERSION_CMD% | find %VERSION_FIND%) >>%REPORT_NAME% 2>&1
206 echo.>>%REPORT_NAME% 2>&1
207 <nul set /p output="."