Page 1 of 3

Borland Make Utility Issues

Posted: Sat Apr 15, 2017 11:16 pm
by James Bott
I am having fits setting up a working Borland 7 make file.

Right now my problem is that after editing a PRG, neither the OBJ or the C files are updated by the make file. So, until I solve this I am forced to delete the OBJ and C file manually. Then they are generated by the make file. Not a good solution.

First, it is my understanding that if the PRG is newer than either the OBJ or C file, then the OBJ and C files should be regenerated automatically. At least that is how the old Clipper Rmake.exe worked.

I have read all the documentation I could find, but there are only a few examples and none discuss or show how to setup the dependencies.

I am assuming this line in the sample make file that comes with FWH is supposed to setup the dependencies:

Code: Select all

arw.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) arw.res
Am I correct? If so, then what is wrong with it? If that is not the line, then which line is it?

Here is my complete make file if it will help:

Code: Select all

#Borland Make file
#Assumes PRGs are in parent directory, and OBJs and Cs are in .\obj
#Using FiveWin, xHarbour, and Borland C++
#Date: 04/13/2017 05:29:45 pm

HBDIR=c:\xharbour
BCDIR=c:\bcc7
FWDIR=c:\fwh

.path.obj = .\obj
.path.prg = .\
.path.ch  = $(FWDIR)\include;$(HBDIR)\include;$(BCDIR)\include
.path.c   = .\obj
.path.rc  = .\

#important: Use Uppercase for filename extensions, in the next two rules!
#But, just for the designation (PRG =) not for the filename's extension. 

PRG = \
arw.prg \
invpost.prg \
arjournl.prg \ 
log.prg\
project.prg\
reorder.prg\
rptproj.prg\
tcharge.prg\
tclient.prg\
texpense.prg\
tinvhist.prg\
tinvoice.prg\
tpayment.prg\
tproject.prg\ 
logpost.prg\
unbilled.prg

OBJ=$(PRG:.prg=.obj)
OBJS=$(OBJ:.\=.\obj\)
#OBJS=$(.\obj\)

PROJECT : arw.exe

#arw.exe : $(OBJS) arw.res
arw.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) arw.res
   echo off
   echo $(BCDIR)\lib\c0w32.obj + > b32.bc
   echo $(OBJS), + >> b32.bc
   echo arw.exe, + >> b32.bc
   echo arw.map, + >> b32.bc
   echo $(FWDIR)\lib\FiveHx.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc
   echo $(FWDIR)\lib\jb32.lib + >> b32.bc
   echo $(FWDIR)\lib\tdata32.lib + >> b32.bc  

   echo $(HBDIR)\lib\rtl.lib + >> b32.bc
   echo $(HBDIR)\lib\vm.lib + >> b32.bc
   echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
   echo $(HBDIR)\lib\lang.lib + >> b32.bc
   echo $(HBDIR)\lib\macro.lib + >> b32.bc
   echo $(HBDIR)\lib\rdd.lib + >> b32.bc
   echo $(HBDIR)\lib\dbfntx.lib + >> b32.bc
   echo $(HBDIR)\lib\dbfcdx.lib + >> b32.bc
   echo $(HBDIR)\lib\dbffpt.lib + >> b32.bc
   echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
   echo $(HBDIR)\lib\debug.lib + >> b32.bc
   echo $(HBDIR)\lib\common.lib + >> b32.bc
   echo $(HBDIR)\lib\pp.lib + >> b32.bc
   echo $(HBDIR)\lib\pcrepos.lib + >> b32.bc
   echo $(HBDIR)\lib\ct.lib + >> b32.bc
   echo $(HBDIR)\lib\zlib.lib + >> b32.bc
   echo $(HBDIR)\lib\hbzip.lib + >> b32.bc
   echo $(HBDIR)\lib\libmisc.lib + >> b32.bc
   echo $(HBDIR)\lib\tip.lib + >> b32.bc
   echo $(HBDIR)\lib\png.lib + >> b32.bc

   echo $(BCDIR)\lib\cw32.lib + >> b32.bc
   echo $(BCDIR)\lib\import32.lib + >> b32.bc
   echo $(BCDIR)\lib\uuid.lib + >> b32.bc
   echo $(BCDIR)\lib\ws2_32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\rasapi32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\psapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\gdiplus.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\shell32.lib, >> b32.bc

   echo arw.res >> b32.bc
   $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s -v -jobj\ @b32.bc
   #$(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
   #del b32.bc

.PRG.OBJ:
   $(HBDIR)\bin\harbour $< /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include
   $(BCDIR)\bin\bcc32 -c -tWM -I$(BCDIR)\include;$(HBDIR)\include -Oobj\$& obj\$&.c 
   #$(BCDIR)\bin\bcc32 -c -tWM -I$(BCDIR)\include -oobj\$& obj\$&.c 

.C.OBJ:
   echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
   echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
   $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
   del tmp

arw.res : arw.rc
   $(BCDIR)\bin\brc32.exe -r -Ic:\bcc7\include\windows\sdk arw.rc
Regards,
James

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 12:08 am
by Antonio Linares
James,

$(PRG:.PRG=.OBJ)

The above line means: In the group of files specified by PRG replace ".PRG" with ".OBJ"

but in the PRG group of files ".prg" is used and not ".PRG"

PRG = \
arw.prg \
invpost.prg \
arjournl.prg \
log.prg\
project.prg\
reorder.prg\
rptproj.prg\
tcharge.prg\
tclient.prg\
texpense.prg\
tinvhist.prg\
tinvoice.prg\
tpayment.prg\
tproject.prg\
logpost.prg\
unbilled.prg

Please fix it and try it again

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 1:34 am
by James Bott
Antonio,

I am not clear what you meant. Did you mean to replace this line:

arw.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) arw.res

With this:

arw.exe : $(OBJ:.prg=.OBJ) $(C:.C=.OBJ) arw.res

If so, that didn't force the recompile either.

James

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 9:10 am
by Marc Venken
Sorry to jump in, but I needed also a new makefile

Should the list of .prg need to be in UPPER maybe.

Maybe I can adjust this file to my purpose (see the topic just set by me)
This way, there is only 1 file needed for compiling ?

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 6:27 pm
by James Bott
Marc,

>Should the list of .prg need to be in UPPER maybe.

I already tried it both ways and it doesn't seem to make any difference.

Originally I had the same problem as you--the EXE would run without error, but no screen would show, and it would immediately exit. I finally fixed that, but I don't know how (I tried so many things I don't remember).

Mine runs fine now, but if I edit a PRG, the OBJ and C files don't get updated when the make file is run again. Obviously the time stamps are not being checked, and I can't figure out how to fix that. Strangely, if the OBJ and C files are deleted (by me), then they are regenerated by the make file, so it is checking that, but not the timestamps.

James

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 7:16 pm
by Antonio Linares
James,

Please review FWH\makes\bor7make.zip and bormake.zip

Try to use them as a skeleton for yours

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 7:49 pm
by James Bott
Antonio,

I started with the Test.mak file that came with FWH 16.02. And I have compared my current MAK file to that file, line by line, dozens of times. Still no luck.

Unfortunately, I cannot actually test the Test.mak (unchanged) that came with FWH because I am using xHarbour and it was written for Harbour. So I had to change the paths and all the libs. And, of course, I have tried so many things that I probably broke something and I can't see it.

What I can try is to start from scratch again. I will take a new copy of test.mak and change the paths and libs, and create test versions of Alert.prg and One.prg, and then see if I can get that working.

James

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 9:32 pm
by Antonio Linares
James,

If you email me all your files then I can build the makefile here for you

I can't try what you have posted here as I don't have all your files

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 9:58 pm
by Marc Venken
Antonio,

I have a simular situation (see other post)

I have compiled and get a exe file from the FW16 to FWh build, but the exe file is not doing anything.
Is this maybe also related to a build file ?

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 10:34 pm
by Antonio Linares
Marc,

Please review the make samples provided at FWH\makes

Check that they work for you. Then introduce your changes progresivelly and keep testing them

Its the simplest way to get a working makefile

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 10:36 pm
by James Bott
Ok, I have had some success and some failure.

I started with the FWH test.mak file. It was dated 2009 so it is quite out of date. I had to copy the library list from the FWH 16.02 Buildx.bat file. I commented out any references to the Two.c file and the Alert.rc file which don’t exist in my sample. Here is the MAK file:

Code: Select all

#Borland make sample, (c) FiveTech Software 2005-2009

HBDIR=c:\xharbour
BCDIR=c:\bcc7
FWDIR=c:\fwh

#change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\
.path.CH  = $(FWDIR)\include;$(HBDIR)\include
.path.C   = .\
.path.rc  = .\

important: Use Uppercase for filenames extensions, in the next two rules!

PRG =        \
alert.PRG    \
one.PRG

#C =          \
#two.C                 

PROJECT    : Alert.exe

Alert.exe  : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) 
   echo off
   echo $(BCDIR)\lib\c0w32.obj + > b32.bc
   #echo obj\alert.obj obj\one.obj obj\two.obj, + >> b32.bc
   echo $(OBJS), + >> b32.bc
   echo alert.exe, + >> b32.bc
   echo alert.map, + >> b32.bc
   echo $(FWDIR)\lib\FiveHx.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc
   echo $(HBDIR)\lib\rtl.lib + >> b32.bc
   echo $(HBDIR)\lib\vm.lib + >> b32.bc
   echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
   echo $(HBDIR)\lib\lang.lib + >> b32.bc
   echo $(HBDIR)\lib\macro.lib + >> b32.bc
   echo $(HBDIR)\lib\rdd.lib + >> b32.bc
   echo $(HBDIR)\lib\dbfntx.lib + >> b32.bc
   echo $(HBDIR)\lib\dbfcdx.lib + >> b32.bc
   echo $(HBDIR)\lib\dbffpt.lib + >> b32.bc
   echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
   echo $(HBDIR)\lib\debug.lib + >> b32.bc
   echo $(HBDIR)\lib\common.lib + >> b32.bc
   echo $(HBDIR)\lib\pp.lib + >> b32.bc
   echo $(HBDIR)\lib\pcrepos.lib + >> b32.bc
   echo $(HBDIR)\lib\ct.lib + >> b32.bc
   echo $(HBDIR)\lib\zlib.lib + >> b32.bc
   echo $(HBDIR)\lib\hbzip.lib + >> b32.bc
   echo $(HBDIR)\lib\libmisc.lib + >> b32.bc
   echo $(HBDIR)\lib\tip.lib + >> b32.bc
   echo $(HBDIR)\lib\png.lib + >> b32.bc

   rem Uncomment these two lines to use Advantage RDD
   rem echo $(HBDIR)\lib\rddads.lib + >> b32.bc
   rem echo $(HBDIR)\lib\Ace32.lib + >> b32.bc

   echo $(BCDIR)\lib\cw32.lib + >> b32.bc
   echo $(BCDIR)\lib\import32.lib + >> b32.bc
   echo $(BCDIR)\lib\uuid.lib + >> b32.bc
   echo $(BCDIR)\lib\ws2_32.lib + >> b32.bc   
   echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\rasapi32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\psapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\gdiplus.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\shell32.lib, >> b32.bc

   IF EXIST Alert.res echo Alert.res >> b32.bc
   $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
   del b32.bc

.PRG.OBJ:
  $(HBDIR)\bin\harbour $< /L /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include
  $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

.C.OBJ:
  echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
  echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
  $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
  del tmp

#Alert.res : Alert.rc
#  $(BCDIR)\bin\brc32.exe -r Alert.rc
 
Then I created an Alert.prg:

Code: Select all

Function main()
    One()
Return nil
 
And a One.prg:

Code: Select all

Function One()
   msgInfo(“Hello World”)
Return nil
 
Then I used the test.mak file to compile the EXE. The Alert.exe was created and runs, then immediately exits without showing the message.

Then I edited the One.prg file (added a space), saved it, and ran the Test.mak file again. I checked the OBJ and C files and they WERE updated with new times, so they are being recompiled when the PRG changes. OK, that’s one-in-a-row.

I still don’t know why the EXE is not working properly. Maybe it is missing a library still. I will look at it some more.

Antonio,
Thanks for offering to get my MAK file going with my PRGs, but if you can just get my above sample running that would be enough. Obviously, you will need to have xHarbour installed, then you might have to change the paths in my Test.mak file.

James

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 10:39 pm
by Marc Venken
Please review FWH\makes\bor7make.zip and bormake.zip
I see a bormake zip, no bor7make.zip

Is the bormake.zip the right one ?

I See and seem to use : FWH+BCC7 files

Just that I look at the right sample.

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 10:54 pm
by Marc Venken
James

I noticed the same issue that you have, but when i change this in the makefile :

If I also use this code :

C = \
TEST1.C \
TEST2.C \
TCALEND.C

and

# echo $(OBJS), + >> b32.bc
echo OBJ\TEST1.OBJ + >> b32.bc
echo OBJ\TEST2.OBJ + >> b32.bc
echo OBJ\TCALEND.OBJ, + >> b32.bc

it works than.

sample sample file that is working for me :

Code: Select all

#Borland make sample, (c) FiveTech Software 2005-2009

HBDIR=c:\harbour
BCDIR=c:\borland\bcc7
FWDIR=c:\fwharb

#change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\
.path.CH  = $(FWDIR)\include;$(HBDIR)\include
.path.C   = .\
.path.RC  = .\

#important: Use Uppercase for filenames extensions, in the next two rules!

PRG =      \
TEST1.PRG  \
TEST2.PRG  \
Tcalend.PRG

C =        \
TEST1.C    \
TEST2.C    \
TCALEND.C

OBJ = $(PRGS:.PRG=.\OBJ)
OBJS = $(OBJ:.\=.\obj\)

PROJECT    : TEST.EXE

#RES-file wordt door COMPRES.BAT aangemaakt
#TEST.EXE  : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) TEST.RES
TEST.EXE  : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ)
   echo off
   echo $(BCDIR)\lib\c0w32.obj + > b32.bc
#  echo $(OBJS), + >> b32.bc
   echo OBJ\TEST1.OBJ + >> b32.bc
   echo OBJ\TEST2.OBJ + >> b32.bc
   echo OBJ\TCALEND.OBJ, + >> b32.bc

   echo TEST.EXE, + >> b32.bc
   echo TEST.MAP, + >> b32.bc
   echo $(FWDIR)\lib\FiveH.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc
   echo $(HBDIR)\lib\hbrtl.lib + >> b32.bc
   echo $(HBDIR)\lib\hbvm.lib + >> b32.bc
   echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
   echo $(HBDIR)\lib\hblang.lib + >> b32.bc
   echo $(HBDIR)\lib\hbmacro.lib + >> b32.bc
   echo $(HBDIR)\lib\hbrdd.lib + >> b32.bc
   echo $(HBDIR)\lib\rddntx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddcdx.lib + >> b32.bc
   echo $(HBDIR)\lib\rddfpt.lib + >> b32.bc
   echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
   echo $(HBDIR)\lib\hbdebug.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcommon.lib + >> b32.bc
   echo $(HBDIR)\lib\hbpp.lib + >> b32.bc
   echo $(HBDIR)\lib\hbwin.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcpage.lib + >> b32.bc
   echo $(HBDIR)\lib\hbct.lib + >> b32.bc
   echo $(HBDIR)\lib\png.lib + >> b32.bc
   echo $(HBDIR)\lib\hbcplr.lib + >> b32.bc
   echo $(HBDIR)\lib\xhb.lib + >> b32.bc
   echo $(HBDIR)\lib\hbtip.lib + >> b32.bc
   echo $(HBDIR)\lib\hbzlib.lib + >> b32.bc
   echo $(HBDIR)\lib\hbmzip.lib + >> b32.bc
   echo $(HBDIR)\lib\hbziparc.lib + >> b32.bc
   echo $(HBDIR)\lib\minizip.lib + >> b32.bc
   echo $(HBDIR)\lib\hbpcre.lib + >> b32.bc

   rem Uncomment these two lines to use Advantage RDD
   rem echo $(HBDIR)\lib\rddads.lib + >> b32.bc
   rem echo $(HBDIR)\lib\Ace32.lib + >> b32.bc

   echo $(BCDIR)\lib\cw32.lib + >> b32.bc
   echo $(BCDIR)\lib\uuid.lib + >> b32.bc
   echo $(BCDIR)\lib\import32.lib + >> b32.bc
   echo $(BCDIR)\lib\ws2_32.lib + >> b32.bc
   echo $(BCDIR)\lib\wininet.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\rasapi32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\gdiplus.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\shell32.lib, >> b32.bc

   IF EXIST TEST.RES echo TEST.RES >> b32.bc
   $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc

.PRG.OBJ:
  $(HBDIR)\bin\harbour $< /N /W0 /V /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include
  $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

.C.OBJ:
  echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
  echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
  $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
  del tmp

#RES-file wordt door COMPRES.BAT aangemaakt
#TEST.RES : ..\RES\TEST.RC
#  $(BCDIR)\bin\brc32.exe -r ..\RES\TEST.RC

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 10:55 pm
by James Bott
Antonio,

I have double checked all the lib files in my modified test.mak file and they are the same as those in the Buildx.bat file that came with FWH 16.2. So, the problem seems to be elsewhere.

James

Re: Borland Make Utility Issues

Posted: Sun Apr 16, 2017 11:53 pm
by James Bott
Marc,

I have tried it with the C file designation before, and I tried it again and it makes no difference--my EXE still isn't working.

If you look at the original test.mak file, the Alert.prg and One.prg are designated as PRGs and the Two.C is only designated as a C file. So, I think the C = designation is for files that ONLY exist as C files, not those that are generated by (x)Harbour from PRGs. But I could be wrong.

James