Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- PBMake 2.17G for Clipper, Xbase++, C and˙+--------------------------------------------------------------+ - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

      If you are using a .CLP file to create one large object, that is
      the first thing to change.

      Instead, compile each source module into it's own object by
      listing all of the source module names without their extensions
      into the .MAK script following the examples I provided.

      Then make a reference to each of the new files in your link
      script instead of a single entry that references the single
      object created by your .CLP file.

      For example, if you were using a file named MYPROG.CLP that reads
      like this:

      prog1
      prog2
      prog3
      another
      andmore
      common
      used
      function

      It would create a single object named MYPROG.OBJ.

      If you change any of the source modules, you have to recompile all
      8 of them. Usually, this is a big waste of time, because only one
      of them is different.

      If you allow PBMake to compile each source module into it's own
      object, there will be 8 objects, and PBMake will then be free to
      only compile the one that changed.

      This is how PBMake can save you time. By breaking the compile
      process into smaller parts. Here is an example script for PBMake
      that would create these smaller objects for you:


+----------------------------------------------------------------------------+
|                 PBMake 2.17G for Clipper, Xbase++, C and ASM               |
|       Copyright (C) 1998 Phil Barnett, All Rights Reserved Worldwide       |
|                           See PBMAKE.NG for help.                          |
+----------------------------------------------------------------------------+

TARGET=MYPROG.EXE

LINKFILE=MYPROG.LNK

LINKER=BLINKER

PROG1= PROG1   PROG2  PROG3 ANOTHER
PROG1= ANDMORE COMMON USED  FUNCTION


      The more complex your source code gets, the more time you save!

      Now you are faced with a new problem. You need a way to assemble
      all those parts.

      With a .CLP file, you probably have been using something like:

      CLIPPER @MYPROG.CLP

      plink86 file MYPROG

      Now that you have broken up the objects, one way to link them
      would be:

      rtlink file prog1,prog2,prog3,another,andmore,common,used,function

      (or whatever linker you are using)

      As you can see, that is going to get old in a hurry, and will
      break the byte limit of the dos command line if it gets much
      longer.

      Fortunately, the linker manufacturers give us a better way.

      As you have seen above, eliminating the .CLP file breaks the large
      object into many smaller ones, but you still need to put them
      together into an target/.EXE.

      So, instead of a list of files that Clipper will compile into a
      single large object, we will make a list of files the linker will
      link together into an target/.EXE.

      This called a linker script, and usually ends in the letters .LNK

      A linker script for the example above (named MYPROG.LNK) would
      look like:

      OUTPUT MYPROG.EXE
      FILE PROG1
      FILE PROG2
      FILE PROG3
      FILE ANOTHER
      FILE ANDMORE
      FILE COMMON
      FILE USED
      FILE FUNCTION

      If you created a file with the above contents you would tell the
      linker to use it like:

      rtlink @MYPROG.LNK

      (or whatever linker you are using)

      PBMake actually writes and executes a batch file that performs all
      of these steps automatically. All you have to do is set up the
      make script correctly, which is a simple process.

      PBMake performs an incremental compile, and saves you time by
      doing as little as possible but all that is necessary to compile a
      fully up to date executable.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson