Blame bcblibs.bat

Packit f574b8
@echo off
Packit f574b8
rem $LynxId: bcblibs.bat,v 1.5 2012/07/05 23:32:15 tom Exp $
Packit f574b8
rem Use this script to construct import-libraries for the Borland C compiler
Packit f574b8
rem from the dll's in the GnuWin32 directory.
Packit f574b8
rem
Packit f574b8
rem The script assumes that the Borland C compiler is already in your %PATH%
Packit f574b8
rem search-list.  It also uses the Windows 2000 command-extensions, which are
Packit f574b8
rem provided in Windows XP and later by default.
Packit f574b8
setlocal
Packit f574b8

Packit f574b8
rem Check if GW32_ROOT is defined, and if not, fill in a default value.
Packit f574b8

Packit f574b8
	if not "x%GW32_ROOT%"=="x" goto exists
Packit f574b8
	set GW32_ROOT=c:\app\gnuwin32
Packit f574b8
:exists
Packit f574b8

Packit f574b8
	if exist "%GW32_ROOT%" goto doit
Packit f574b8
	echo ? %GW32_ROOT% does not exist
Packit f574b8
	goto finish
Packit f574b8

Packit f574b8
:doit
Packit f574b8
	rem do this just in case it is needed
Packit f574b8
	set PATH=%PATH%;%GW32_ROOT\bin
Packit f574b8

Packit f574b8
	set SAVE_CD="%CD%"
Packit f574b8
	cd %GW32_ROOT%
Packit f574b8

Packit f574b8
	if not exist bcblibs mkdir bcblibs
Packit f574b8

Packit f574b8
	cd bin
Packit f574b8
	if ERRORLEVEL 1 goto failed
Packit f574b8

Packit f574b8
	for %%N in (*.dll) do call :implib %%~nN%
Packit f574b8

Packit f574b8
	cd %CD%
Packit f574b8
	goto finish
Packit f574b8

Packit f574b8
:implib
Packit f574b8
	echo making import-library for %1
Packit f574b8
	set SOURCE=%1.dll
Packit f574b8
	set TARGET=..\bcblibs\%1.lib
Packit f574b8
	copy %1.dll ..\bcblibs
Packit f574b8
	implib -a %TARGET% %1.dll
Packit f574b8
	:goto :eof
Packit f574b8

Packit f574b8
:failed
Packit f574b8

Packit f574b8
:finish
Packit f574b8
endlocal