Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.7 KiB

  1. REM make-rdrand
  2. @echo OFF
  3. @cls
  4. @del rdrand.obj rdrand-x86.obj rdrand-x64.obj rdrand-x86.lib rdrand-x64.lib /Q > nul
  5. REM Visual Studio 2005
  6. REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin
  7. REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\amd64
  8. REM Visual Studio 2010
  9. REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 10\VC\bin
  10. REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 10\VC\bin\amd64
  11. REM Visual Studio 2012
  12. REM @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
  13. REM @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64
  14. REM Visual Studio 2013
  15. @set TOOLS32=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
  16. @set TOOLS64=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64
  17. @set MASM="%TOOLS32%\ml.exe"
  18. @set MASM64="%TOOLS64%\ml64.exe"
  19. @set DUMPBIN="%TOOLS32%\dumpbin.exe"
  20. @set LIBTOOL="%TOOLS32%\lib.exe"
  21. REM /W3 - Warning level
  22. REM /Cx - Preserve case in external symbols
  23. REM /Zi - Porgram Database information
  24. @set ASFLAGS=/nologo /D_M_X86 /W3 /Cx /Zi /safeseh
  25. @set ASFLAGS64=/nologo /D_M_X64 /W3 /Cx /Zi
  26. @set LIBFLAGS=/nologo /SUBSYSTEM:CONSOLE
  27. REM Use _M_X86 and _M_X64 becuase cl.exe uses them. It keeps preprocessor defines consistent.
  28. echo ****************************************
  29. echo Assembling rdrand.asm into rdrand-x86.obj
  30. call %MASM% %ASFLAGS% /Fo rdrand-x86.obj /c rdrand.asm > nul
  31. @IF NOT %ERRORLEVEL% EQU 0 (echo Failed to assemble rdrand.asm with X86 && goto SCRIPT_FAILED)
  32. echo Done...
  33. echo ****************************************
  34. echo Assembling rdrand.asm into rdrand-x64.obj
  35. call %MASM64% %ASFLAGS64% /Fo rdrand-x64.obj /c rdrand.asm > nul
  36. @IF NOT %ERRORLEVEL% EQU 0 (echo Failed to assemble rdrand.asm with X64 && goto SCRIPT_FAILED)
  37. echo Done...
  38. echo ****************************************
  39. echo Creating static library rdrand-x86.lib
  40. call %LIBTOOL% %LIBFLAGS% /MACHINE:X86 /OUT:rdrand-x86.lib rdrand-x86.obj > nul
  41. @IF NOT %ERRORLEVEL% EQU 0 (echo Failed to create rdrand-x86.lib && goto SCRIPT_FAILED)
  42. echo Done...
  43. echo ****************************************
  44. echo Creating static library rdrand-x64.lib
  45. call %LIBTOOL% %LIBFLAGS% /MACHINE:X64 /OUT:rdrand-x64.lib rdrand-x64.obj > nul
  46. @IF NOT %ERRORLEVEL% EQU 0 (echo Failed to create rdrand-x64.lib && goto SCRIPT_FAILED)
  47. echo Done...
  48. goto SKIP_SYMBOL_DUMP_OBJ
  49. echo ****************************************
  50. echo Dumping symbols for rdrand-x86.obj
  51. echo.
  52. call %DUMPBIN% /SYMBOLS rdrand-x86.obj
  53. echo ****************************************
  54. echo Dumping symbols for rdrand-x64.obj
  55. echo.
  56. call %DUMPBIN% /SYMBOLS rdrand-x64.obj
  57. :SKIP_SYMBOL_DUMP_OBJ
  58. goto SKIP_SYMBOL_DUMP_LIB
  59. echo ****************************************
  60. echo Dumping symbols for rdrand-x86.lib
  61. echo.
  62. call %DUMPBIN% /SYMBOLS rdrand-x86.lib
  63. echo ****************************************
  64. echo Dumping symbols for rdrand-x64.lib
  65. echo.
  66. call %DUMPBIN% /SYMBOLS rdrand-x64.lib
  67. :SKIP_SYMBOL_DUMP_LIB
  68. goto SKIP_EXPORT_DUMP
  69. echo ****************************************
  70. echo Dumping exports for rdrand-x86.lib
  71. echo.
  72. call %DUMPBIN% /EXPORTS rdrand-x86.lib
  73. echo ****************************************
  74. echo Dumping exports for rdrand-x64.lib
  75. echo.
  76. call %DUMPBIN% /EXPORTS rdrand-x64.lib
  77. :SKIP_EXPORT_DUMP
  78. REM goto SKIP_DISASSEMBLY
  79. echo ****************************************
  80. echo Disassembling rdrand-x64.obj
  81. echo.
  82. call %DUMPBIN% /DISASM:NOBYTES rdrand-x64.obj
  83. echo ****************************************
  84. echo Disassembling rdrand-x86.obj
  85. echo.
  86. call %DUMPBIN% /DISASM:NOBYTES rdrand-x86.obj
  87. :SKIP_DISASSEMBLY
  88. :SCRIPT_FAILED