compiling multiple source files

Post Reply
User avatar
Greg Gammon
Posts: 105
Joined: Fri Jun 09, 2006 3:27 pm
Location: Bryan, Texas

compiling multiple source files

Post by Greg Gammon »

Ok...rookie question....its been so long since Ive needed to do this....
I have my source code in one large PRG file...I want to break into multiple PRG modules. How do I compile (harbour) using multiple PRG files?

thanx
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Greg,

The best way to build an application with multiple PRGs is using a make file.

At FWH/makes you have bormake.zip that includes a Borland make sample and the used files to build a FWH app. There is also a msmake.zip sample in case that you want to use Microsoft make instead of Borland make.

In case that you just want to modify samples\buildh.bat or buildx.bat files to manage several PRGs (one.prg, two.prg and three.prg), then all you have to do is:

%hdir%\bin\harbour one /n /i%fwh%\include;%hdir%\include /w /p

%hdir%\bin\harbour two /n /i%fwh%\include;%hdir%\include /w /p
%hdir%\bin\harbour three /n /i%fwh%\include;%hdir%\include /w /p


%bcdir%\bin\bcc32 -M -c -O2 -I%hdir%\include one.c
%bcdir%\bin\bcc32 -M -c -O2 -I%hdir%\include two.c
%bcdir%\bin\bcc32 -M -c -O2 -I%hdir%\include three.c

echo c0w32.obj + > b32.bc

echo one.obj + >> b32.bc

echo two.obj + >> b32.bc
echo three.obj, + >> b32.bc
echo one.exe, + >> b32.bc

...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply