Page 1 of 1

compiling multiple source files

Posted: Sat Aug 04, 2007 8:21 pm
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

Posted: Sat Aug 04, 2007 10:49 pm
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

...