INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Steps to compile/link in clipper.

Steps to compile/link in clipper.

(OP)
Hello,

I've got an application in Clipper. The application runs from a specific folder where the .prg, .obj, and .exe files reside.

I already modified the program ciediar.prg but I don't know the process to compile and/or link my new ciediar.prg with the current control.exe in order for it to recognize the changes.

Thanks in advance

RE: Steps to compile/link in clipper.

Usually there are batchfiles set up to accomplish that task, didn't the original programmer make any of them? Could also be a .rmk file, as it used to be the default extension for RMake scripts. (RMake is a sort of make tool, not very compatible with either Gnu, Borland or MS make) (RMake docs are in the Norton Guides)

HTH
TonHu

RE: Steps to compile/link in clipper.

(OP)
Thanks for your help TonHu.

I forgot to mention that I am not a Clipper expert. I used a batch file to compile my program (cl.bat) wich contains the following lines:

clipper %1  -B  
if not errorlevel 1 rtlink file %1


My understanding is that the first line is the compilation process but I'm not sure what the second line does. I compiled my ciediar.prg using the cl.bat and put the new ciediar.obj in the application folder where the control.exe (the application) is located.

What exactly does the rmake tool do? I found this rmake.exe file under the clipper folder.

I appreciate your help.

Thanks!

RE: Steps to compile/link in clipper.

Hi Alex
The first line does compile the .prg file, the second links it with the standard libraries to make an .exe file.

That's probably just intended for 'quickie' fixes - the application itself will probably involve compiling a series of .prg files (which then become .obj files) and then linking them all together to make one (much larger) .exe file.

Are there any other .bat files 'lying around'?

Myself, I use a .bat file called mk.bat this calls a utility called 'make', or 'rtmake' sometimes, which scans a list of .prg files, comparing them with their matching .obj files and only recompiles those that are newer - then calls the linker (in your case rtlink) to combile them in a predefined fashion to create a named .exe file.

Can you see much like that ? Often these won;t work without some environment variables being set first (to tell the system where to find the linker, libraries and .obj files).

Regards

Griff
Keep ing

RE: Steps to compile/link in clipper.

(OP)

Thanks Griff,

I think I almost get to the link process. Do you know what is the syntax to link the .obj files? How do I run the rmake program? How do I reference the corresponding libraries?

I appreciate your help!

RE: Steps to compile/link in clipper.

If your mod was just to one .prg file, then the 'make' is pretty much redundant - you can just compile you .prg to make the obj. So long as you know what options to use; such as -m or what ever.

I'm not sure if there is a standard for make file extensions, I use .MK5 yours might be .rmk or .mak or something else.

Essentially you'd be calling the rmake utility with that file as the parameter:

CODE

c:\utils\rmake myfile.mk5

This will then (probably) call a batch file to compile each .prg with a command line something like:

CODE

call cl50obj myprog

In turn that will probably have something like this in it:

CODE

c:\lang\cl50\bin\clipper %1.prg -m %2 %3 %4 -ustd.ch -oOBJ\%1.obj

This assumes that the clipper compiler is in the c:\lang\cl50\bin folder.

%1 would be the parameter passed to the batch file with the .prg name (the .prg itself being omitted deliberately)

-m means compile the files specified in a module
-ustd.ch tells the compiler to look in std.ch for any odd command preprocessor instructions
-oOBJ\%1.obj tells the compiler to use the file name specified in the parameter again to direct the compiler output to a file in a subfolder called OBJ and to put the .obj extension on it!

%2 %3 %4 are just in case extra parameters are uses to include extra .prg files.

After that we have linking!

I use another script for this in my case with a .lk5 extension - but there is a standard for this one! it is .lnk and it will typically contain something like this:

CODE

BLINKER EXECUTABLE CLIPPER F225;E0;
#BLINKER HOST MESSAGE ON
BLINKER INCREMENTAL OFF
BLINKER EXECUTABLE EXTENDED
# output file
OUTPUT \apps\myprog\WORK\myprog
OVERLAY CODE,$CONSTANTS
# burn in the clipper variables...
# core part in memory
FI obj\myprog
FI obj\DOSPROC
FI obj\genproc
FI OBJ\ARRAPROC
FI OBJ\TBROPROC
FI OBJ\ERRORSYS

   search C:\LANG\cl50\lib\BLXCLP50
   LIB C:\LANG\cl50\lib\clipper
   search C:\LANG\cl50\lib\EXTEND
   search C:\LANG\cl50\lib\dbfntx
   search C:\LANG\cl50\lib\terminal
#  search cl

BEGINAREA
        SECTION FI OBJ\PRINFUNC
        SECTION FI OBJ\PROJPROC
        SECTION FI OBJ\CONTPROC
        SECTION FI OBJ\CNTRPROC
ENDAREA

The example is for Blinker - but is similar to RTLink (I think)

You might not need the environment variables, because the paths etc are specified in the .lnk/.lk5 file.

So you are just left invoking the whole thing:

CODE

c:\utils\blinker @mylink.lk5

The @ tells the linker to take it's instructions from the specified file

I hope this all helps and good luck to you


Regards

Griff
Keep ing

RE: Steps to compile/link in clipper.

Quote:

The example is for Blinker - but is similar to RTLink (I think)

Sorry to say, but that was the other way around... Blinker has a (sort-of but not usefull) RTlink compatible mode.

I looked up an old RTlink script (1993) I never use anymore, but it should still work winky smile

CODE

# Linkscript for .RTLink
Resident
# Main program-module
File Z
Dynamic
# Several obj-files, dynamically loaded:
File Init, Aanmaak
File Hoofd1, Hoofd2, Hoofd2, Hoofd3, Hoofd4, Hoofd4
# libraries:
Search TK91, SubNTX, Expand, NanFor
# exe-name:
Output Z

HTH
TonHu

RE: Steps to compile/link in clipper.

Hi TonHu,

It's not the same is it! happy shades

With your example he should be able to fine any existing ones though...

Thanks

Martin

Regards

Griff
Keep ing

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close