bcblibs.bat 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @echo off
  2. rem $LynxId: bcblibs.bat,v 1.5 2012/07/05 23:32:15 tom Exp $
  3. rem Use this script to construct import-libraries for the Borland C compiler
  4. rem from the dll's in the GnuWin32 directory.
  5. rem
  6. rem The script assumes that the Borland C compiler is already in your %PATH%
  7. rem search-list. It also uses the Windows 2000 command-extensions, which are
  8. rem provided in Windows XP and later by default.
  9. setlocal
  10. rem Check if GW32_ROOT is defined, and if not, fill in a default value.
  11. if not "x%GW32_ROOT%"=="x" goto exists
  12. set GW32_ROOT=c:\app\gnuwin32
  13. :exists
  14. if exist "%GW32_ROOT%" goto doit
  15. echo ? %GW32_ROOT% does not exist
  16. goto finish
  17. :doit
  18. rem do this just in case it is needed
  19. set PATH=%PATH%;%GW32_ROOT\bin
  20. set SAVE_CD="%CD%"
  21. cd %GW32_ROOT%
  22. if not exist bcblibs mkdir bcblibs
  23. cd bin
  24. if ERRORLEVEL 1 goto failed
  25. for %%N in (*.dll) do call :implib %%~nN%
  26. cd %CD%
  27. goto finish
  28. :implib
  29. echo making import-library for %1
  30. set SOURCE=%1.dll
  31. set TARGET=..\bcblibs\%1.lib
  32. copy %1.dll ..\bcblibs
  33. implib -a %TARGET% %1.dll
  34. :goto :eof
  35. :failed
  36. :finish
  37. endlocal