Unified · Split
| @@ -3,12 +3,13 @@ · 2 unmodified lines | |||
| 3 | @rem ------------------------------------------------------ | 3 | @rem ------------------------------------------------------ |
| 4 | 4 | ||
| 5 | @echo off | 5 | @echo off |
| 6 | setlocal | ||
| 6 | 7 | ||
| 8 | set VSCOMNTOOLS=%VS150COMNTOOLS% | ||
| 9 | if "%VSCOMNTOOLS%"=="" set VSCOMNTOOLS=%VS140COMNTOOLS% | ||
| 10 | if "%VSCOMNTOOLS%"=="" set VSCOMNTOOLS=%VS130COMNTOOLS% | ||
| 11 | if "%VSCOMNTOOLS%"=="" set VSCOMNTOOLS=%VS120COMNTOOLS% | ||
| 7 | set CC=gcc -Os -s | 12 | set CC=gcc -Os -s |
| 8 | |||
| 9 | set T=32 | ||
| 10 | if %PROCESSOR_ARCHITECTURE%_==AMD64_ set T=64 | ||
| 11 | if %PROCESSOR_ARCHITEW6432%_==AMD64_ set T=64 | ||
| 12 | set /p VERSION= < ..\VERSION | 13 | set /p VERSION= < ..\VERSION |
| 13 | set INST= | 14 | set INST= |
| 14 | set DOC=no | 15 | set DOC=no |
| @@ -68,6 +69,17 @@ goto :a1 · 53 unmodified lines | |||
| 68 | :a7 | 69 | :a7 |
| 69 | if not (%1)==() goto :usage | 70 | if not (%1)==() goto :usage |
| 70 | 71 | ||
| 72 | if not "%CC%"=="@call :cl" goto :p1 | ||
| 73 | if %T%_==32_ set CLVARS="%VSCOMNTOOLS%..\..\VC\bin\vcvars32.bat" | ||
| 74 | if %T%_==64_ set CLVARS="%VSCOMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat" | ||
| 75 | if %T%_==_ set T=32& if %Platform%_==X64_ set T=64 | ||
| 76 | :p1 | ||
| 77 | if not %T%_==_ goto :p2 | ||
| 78 | set T=32 | ||
| 79 | if %PROCESSOR_ARCHITECTURE%_==AMD64_ set T=64 | ||
| 80 | if %PROCESSOR_ARCHITEW6432%_==AMD64_ set T=64 | ||
| 81 | :p2 | ||
| 82 | |||
| 71 | set D32=-DTCC_TARGET_PE -DTCC_TARGET_I386 | 83 | set D32=-DTCC_TARGET_PE -DTCC_TARGET_I386 |
| 72 | set D64=-DTCC_TARGET_PE -DTCC_TARGET_X86_64 | 84 | set D64=-DTCC_TARGET_PE -DTCC_TARGET_X86_64 |
| 73 | if %T%==64 goto :t64 | 85 | if %T%==64 goto :t64 |
| @@ -85,6 +97,9 @@ set PX=i386-win32 · 11 unmodified lines | |||
| 85 | 97 | ||
| 86 | @echo on | 98 | @echo on |
| 87 | 99 | ||
| 100 | @if %CLVARS%_==_ goto :config.h | ||
| 101 | call %CLVARS% | ||
| 102 | |||
| 88 | :config.h | 103 | :config.h |
| 89 | echo>..\config.h #define TCC_VERSION "%VERSION%" | 104 | echo>..\config.h #define TCC_VERSION "%VERSION%" |
| 90 | echo>> ..\config.h #ifdef TCC_TARGET_X86_64 | 105 | echo>> ..\config.h #ifdef TCC_TARGET_X86_64 |
| @@ -93,7 +108,7 @@ echo>> ..\config.h #else · 2 unmodified lines | |||
| 93 | echo>> ..\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/32;{B}/lib" | 108 | echo>> ..\config.h #define CONFIG_TCC_LIBPATHS "{B}/lib/32;{B}/lib" |
| 94 | echo>> ..\config.h #endif | 109 | echo>> ..\config.h #endif |
| 95 | 110 | ||
| 96 | for %%f in (*tcc.exe tiny_*.exe *tcc.dll) do @del %%f | 111 | @del /q *tcc.exe tiny_*.exe *tcc.dll |
| 97 | 112 | ||
| 98 | :compiler | 113 | :compiler |
| 99 | %CC% -o libtcc.dll -shared ..\libtcc.c %D% -DONE_SOURCE -DLIBTCC_AS_DLL | 114 | %CC% -o libtcc.dll -shared ..\libtcc.c %D% -DONE_SOURCE -DLIBTCC_AS_DLL |
| @@ -153,7 +168,7 @@ cmd /c makeinfo --html --no-split ../tcc-doc.texi -o doc/tcc-doc.html · 53 unmodified lines | |||
| 153 | :doc-done | 168 | :doc-done |
| 154 | 169 | ||
| 155 | :files-done | 170 | :files-done |
| 156 | for %%f in (*.o *.def *-m??.exe) do @del %%f | 171 | @del /q *.o *.def *-m??.exe |
| 157 | 172 | ||
| 158 | :copy-install | 173 | :copy-install |
| 159 | @if (%INST%)==() goto :the_end | 174 | @if (%INST%)==() goto :the_end |