DOS Build script for MinGW/Win32

DOS specific questions.
Post Reply
counting_pine
Site Admin
Posts: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

DOS Build script for MinGW/Win32

Post by counting_pine »

I've written a batch script which should be able to download the latest FreeBASIC for DOS and setup tools, and make a working version from the source code.

It is based on the instructions at http://www.freebasic.net/wiki/DevBuild#DjgppBuild.

You just need to have wget and unzip available in the %path%. It also requires a recent version of the FreeBASIC source code to be available in C:\fbc-dos. It probably requires a 32-bit version of Windows so it can run the DOS programs.

I would be interested to hear how it works for people. I have only tested it on my own system, but it did not install DJGPP from scratch since I have it on my system already.

Code: Select all

setlocal

set FBDOS=FreeBASIC-1.05-dos

C:

:: Installs latest FreeBASIC for DOS to C:\%FBDOS% (where %FBDOS% is the root name of the zip file)

md C:\%FBDOS%
cd C:\%FBDOS%

wget --no-clobber http://sourceforge.net/projects/fbc/files/Binaries%20-%20DOS/%FBDOS%.zip
unzip -n %FBDOS%.zip -d C:/


:: Installs DJGPP

md C:\DJGPP
cd C:\DJGPP

wget --no-clobber http://www.delorie.com/pub/djgpp/beta/v2/djdev204.zip
unzip -n djdev204.zip -d C:/DJGPP

for %%i in (bnu2232a bnu2232b bsh204b fil41b gcc473b gpp473b mak3791b shl2011b txt20b) do (
 wget --no-clobber http://www.delorie.com/pub/djgpp/current/v2gnu/%%i.zip
 unzip -n %%i.zip -d C:/DJGPP
)

set path=C:\DJGPP\bin;C:\%FBDOS%
set DJGPP=C:\DJGPP\djgpp.env


:: makes the latest version of FreeBASIC (source must be found in C:\fbc-dos\)

cd C:\fbc-dos
echo ENABLE_STANDALONE := YesPlease> C:\fbc-dos\config.mk
make clean
make

for %%i in (ar as ld) do copy C:\DJGPP\bin\%%i.exe C:\fbc-dos\bin\dos\

for %%i in (crt0 gcrt0) do copy C:\DJGPP\lib\%%i.o C:\fbc-dos\lib\
for %%i in (emu m) do copy C:\DJGPP\lib\lib%%i.a C:\fbc-dos\lib\
copy C:\DJGPP\lib\gcc\djgpp\4.73\libgcc.a C:\fbc-dos\lib\
copy C:\%FBDOS%\lib\dos\libc.a C:\fbc-dos\lib\
copy C:\DJGPP\lib\libsupcxx.a C:\fbc-dos\lib\libsupcx.a

endlocal
pause
Post Reply