Author: peterw Date: Sun Dec 10 06:04:27 2006 New Revision: 25106
URL: http://svn.reactos.org/svn/reactos?rev=25106&view=rev Log: - Added -x2 option to automatically double the number of CPUs detected and added makex.cmd to use it. - This reflects changes added for use in the RosBE.
Added: trunk/tools/mingw-make/makex.cmd Modified: trunk/tools/mingw-make/cpucount.c trunk/tools/mingw-make/make.cmd
Modified: trunk/tools/mingw-make/cpucount.c URL: http://svn.reactos.org/svn/reactos/trunk/tools/mingw-make/cpucount.c?rev=251... ============================================================================== --- trunk/tools/mingw-make/cpucount.c (original) +++ trunk/tools/mingw-make/cpucount.c Sun Dec 10 06:04:27 2006 @@ -1,8 +1,25 @@ #include <windows.h> +#include <stdio.h>
-int main() { - SYSTEM_INFO sysinfo; - GetSystemInfo(&sysinfo); - printf("%ld\n", sysinfo.dwNumberOfProcessors); +int main(int argc, char* argv[]) +{ + SYSTEM_INFO SystemInformation; + + if (argc == 1) + { + GetSystemInfo(&SystemInformation); + printf("%ld\n", SystemInformation.dwNumberOfProcessors); + return 0; + } + else if (!strcmp(argv[1], "-x2")) + { + GetSystemInfo(&SystemInformation); + printf("%ld\n", (SystemInformation.dwNumberOfProcessors + SystemInformation.dwNumberOfProcessors)); + return 0; + } + else + { + printf("Unknown parameter specified. Exiting.\n"); + return 1; + } } -
Modified: trunk/tools/mingw-make/make.cmd URL: http://svn.reactos.org/svn/reactos/trunk/tools/mingw-make/make.cmd?rev=25106... ============================================================================== --- trunk/tools/mingw-make/make.cmd (original) +++ trunk/tools/mingw-make/make.cmd Sun Dec 10 06:04:27 2006 @@ -1,4 +1,5 @@ @echo off -for /f "usebackq" %%i IN (`cpucount`) DO @set CPUCOUNT=%%i + +for /f "usebackq" %%i in (`cpucount`) do set CPUCOUNT=%%i echo %CPUCOUNT% Processors detected. -mingw32-make -j %CPUCOUNT% %* +rem mingw32-make -j %CPUCOUNT% %*
Added: trunk/tools/mingw-make/makex.cmd URL: http://svn.reactos.org/svn/reactos/trunk/tools/mingw-make/makex.cmd?rev=2510... ============================================================================== --- trunk/tools/mingw-make/makex.cmd (added) +++ trunk/tools/mingw-make/makex.cmd Sun Dec 10 06:04:27 2006 @@ -1,0 +1,5 @@ +@echo off + +for /f "usebackq" %%i in (`cpucount -x2`) do set CPUCOUNT=%%i +echo %CPUCOUNT% Processors detected (Automatically doubled). +rem mingw32-make -j %CPUCOUNT% %*