home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / xbase / library / clipper / pwrmake / pwrmake.doc < prev    next >
Encoding:
Text File  |  1992-07-14  |  10.6 KB  |  355 lines

  1. PWRMAKE Version 1.4
  2. Copyright (c) 1991-1992 Clifford Wiebe [CIS ID: 73670,1377]
  3.  
  4. HISTORY
  5. ───────
  6.  
  7. Tue  07-14-1992 v1.4
  8.  
  9. My sincere apologies. Version 1.3 was uploaded with two support
  10. functions missing: DEFAULT (UDC from Rick Spence's book) and
  11. StripPath(), which strips a path from a filename. Include files
  12. commands.ch and string.ch are no longer necessary nor referenced.
  13.  
  14. Sun  07-05-1992  v1.3
  15.  
  16.  
  17. INTRODUCTION
  18. ────────────
  19.  
  20. Pwrmake that will create a series of files to assist the developer in
  21. maintaining Clipper 5.1 project. It creates a make file, utilizing the
  22. clipper environment variables for the object, header, lib and compiler
  23. directives. Two batch files are also created, BACKUP.BAT and
  24. RESTORE.BAT. These two files allow automated backup and restore of the
  25. project.  These batch files use a program, CHECKVOL.EXE, which is
  26. included, to verify the volume label on the diskette.
  27.  
  28. Powermake came about while trying to explain make files to other
  29. developers in our shop. Most of them were using Summer 87 and had
  30. never used the make utility included with Clipper. Most often they
  31. created a batch file which compiled the whole system, a task that's
  32. worth getting a coffee even if you're using a 386.
  33.  
  34. Why should I use make files?
  35.  
  36. 1.    Faster recompiling of projects. Only the programs that were
  37.     modified will be compiled.
  38.  
  39. 2.    Built-in project documentation. By looking at the .RMK file, the
  40.     developer can see all source files needed to recreate the project.
  41.  
  42. 3.    Less documentation required for a project. Have you ever had to
  43.     make a change to someone else's code when he/she is on holidays?
  44.     It takes time just to figure out which programs should be
  45.     included. Using Pwrmake, the same command is used to make any
  46.     system, COMPILE.BAT.
  47.  
  48. USING PWRMAKE
  49. ─────────────
  50.  
  51.     Syntax PwrMake /nproject [switches]
  52.  
  53.     where:        /n<project> = project name
  54.  
  55.     switches:    /a<name>    = author's name
  56.                 /b<dir>     = backup directory, defaults to c:\zip
  57.                 /c<compiler>= compiler name, defaults to CLIPPER.EXE
  58.                 /o            = overwrite existing files without prompting
  59.                 /d<dir>     = dbf file directory, defaults to current directory
  60.                 /?            = displays help screen
  61.                 /m<MainPrg> = Main (.prg) file for project. This file
  62.                               will not be overlayed by BLINKER.
  63.                               Defaults to <project> if omitted.
  64.  
  65.     Files Created:
  66.                 compile.bat    runs RMAKE with <project>.rmk
  67.                 backup.bat       Backs up complete system to zipfile and
  68.                                diskette. /DATA will backup dbf/ntx files
  69.                 restore.bat    Restores system from diskette saved with
  70.                                Backup.bat. /DATA restores dbf/ntx files.
  71.                 <project>.RMK  Make file
  72.                 <project>.LNK  Link file
  73.                 <project>.LST  File list for pkzip
  74.  
  75. Compiling PwrMake
  76. ─────────────────
  77.  
  78.     I know that Pwrmake doesn't follow the normal rules of modular
  79.     programming. This was done for simplicities sake, I just didn't
  80.     think it was worth it. The executable program is not included
  81.     in this archive, you must compile and link Pwrmake before you
  82.     can use it.
  83.  
  84.     To create Pwrmake.exe:
  85.  
  86.     Compile with Clipper 5.01
  87.         CLIPPER pwrmake /n            no implicit startup procedure
  88.  
  89.         BLINKER FI pwrmake            assumes environment LIB is set.
  90.  
  91.  
  92. USING PWRMAKE
  93. ─────────────
  94.  
  95.     1.    Change to the directory where the make files are to built.
  96.  
  97.     2.    Key in the Pwrmake command line
  98.  
  99.         Pwrmake /nBigProj /aClifford Wiebe /o /bc:\backup /dc:\data
  100.                 /cCLIPWARN /mPwrMake
  101.  
  102.     3.    That's it. All the required files are created and you are returned
  103.         to DOS.
  104.  
  105. Explanation of Files
  106. ────────────────────
  107.  
  108.     The examples given here are the actual files created when you run
  109.     Pwrmake in a separate directory with Pwrmake.prg using the command
  110.     line above.
  111.  
  112.     COMPILE.BAT             batch file to invoke rmake
  113.  
  114.     Syntax:     COMPILE
  115.  
  116.     COMPILE assumes rmake is on your path. It is a simple batch file
  117.     that calls RMAKE with the rmake file.
  118.  
  119.     *----------------------------------------------------------------
  120.  
  121.     BIGPROJ.RMK           RMAKE compatible make file
  122.  
  123.  
  124.     Example make file:
  125.  
  126.     // Make File....: BIGPROJ
  127.     // Date Created.: 07/04/92
  128.     // Author.......: Clifford Wiebe
  129.     // Comments.....: Created by Pwrmake
  130.     //
  131.  
  132.     // Make File macros
  133.     COMPILER        = CLIPWARN                // Compiler Name
  134.     CLIPPERCMD        = /v /w /m                // Default Compiler Directives
  135.     LINKERNAME        = BLINKER                // Linker name
  136.     CLIPDEBUG        = /v /w /m /b            // Debug Compiler Directives
  137.  
  138.     // makepath macros
  139.     makepath[.obj] = .;C:\CLIPPER5\OBJ
  140.     makepath[.ch]  = C:\CLIPPER5\INCLUDE
  141.     makepath[.lib] = C:\CLLIPPER5\LIB
  142.     makepath[.pll] = C:\CLIPPER5\PLL
  143.  
  144.     // Inference rules
  145.     .PRG.OBJ:
  146.         $(COMPILER) $* (CLIPPERCMD)
  147.  
  148.     PWRMAKE.OBJ    :      PWRMAKE.PRG
  149.  
  150.     BIGPROJ.EXE    :
  151.        $(LINKERNAME) @BIGPROJ.LNK
  152.  
  153.     *----------------------------------------------------------------
  154.  
  155.     BIGPROJ.LNK                 Link File
  156.  
  157.     #  Link File....: BIGPROJ
  158.     #  Date Created.: 07/04/92
  159.     #  Author.......: Clifford Wiebe
  160.  
  161.     BLINKER OVERLAY FIXED
  162.     BLINKER OVERLAY UMB ON
  163.     BLINKER OVERLAY PAGEFRAME ON
  164.     BLINKER ENVIRONMENT NAME BIGPROJ
  165.     BLINKER INCREMENTAL ON
  166.     OUTPUT pwrmake.exe
  167.     FILE   pwrmake
  168.     #Force commonly used routines resident
  169.     #module -*-*-* place common routine here
  170.     BEGINAREA
  171.         FILE pwrmake
  172.     ENDAREA
  173.     # Overlayed Library files, could be replaced with
  174.     # one of various (.std) files available
  175.     BEGINAREA
  176.         allocate nanfor
  177.         allocate extend
  178.     ENDAREA
  179.     SEARCH CLIPPER
  180.     SEARCH DBFNTX
  181.     SEARCH TERMINAL
  182.  
  183.     If you use a profiler to determine which modules would benefit
  184.     from staying resident, replace the module line including those
  185.     functions.
  186.  
  187.     ie: .
  188.         .
  189.         .
  190.         module setcursor, qout in clipper
  191.         .
  192.         .
  193.         .
  194.     *----------------------------------------------------------------
  195.  
  196.     BACKUP.BAT                used to backup project in current directory
  197.  
  198.     Syntax:     BACKUP [ A: / B:]
  199.  
  200.     This file can be used to move projects from one computer to another,
  201.     or to keep a backup to restore if your idea wasn't as good as you
  202.     thought it was. The diskette drive letter must be specified on the
  203.     BACKUP command line. The CheckVol utility is used to verify the label
  204.     on the diskette in the drive. You can put a label on a diskette with
  205.     DOS's LABEL or Norton's VL command. This ensures you have the correct
  206.     diskette in the drive. BACKUP.BAT zips all the files listed in
  207.     BIGPROJ.LST in the directory specified with the /b parameter. The
  208.     zipfile is then copied to the diskette in the drive specified on
  209.     the command line.
  210.  
  211.  
  212.     @Echo Off
  213.     REM Backup Batch File created by PwrMake on 07/04/92
  214.     if (%1)==() goto nodrive
  215.  
  216.     REM    Next section uses CheckVol to verify the disk is correct
  217.     REM    You can use the DOS Label or Nortons VL command to put
  218.     REM    a volume label on a disk
  219.     REM    Checkvol is a utility written in C
  220.     :checkdisk
  221.     checkvol %1BIGPROJ
  222.     if errorlevel 1 goto wrong
  223.     goto continue
  224.     :wrong
  225.     Echo BIGPROJ disk not found in Drive %1
  226.     pause
  227.     goto checkdisk
  228.  
  229.     :continue
  230.     Echo Backing up BIGPROJ system to Drive %1 using BIGPROJ.LST
  231.     if not exist c:\backup\NUL echo Creating c:\backup\ directory
  232.     if not exist c:\backup\*.* if not exist c:\backup\NUL md c:\backup
  233.     pkzip -u c:\backup\BIGPROJ @BIGPROJ.lst
  234.     echo Copying ZipFile to Diskette in Drive %1
  235.     copy c:\backup\BIGPROJ.zip %1 > NUL
  236.  
  237.     REM Check if data should be backed up
  238.     if (%2)==() goto end
  239.     if (%2)==(/DATA) goto data
  240.     if (%2)==(/data) goto data
  241.     goto end
  242.  
  243.     :DATA
  244.     Echo Backing up DBF/NTX files
  245.     pkzip -u c:\backup\BIGPROJD c:\data\*.dbf c:\data\*.ntx
  246.     Echo Ready to move BIGPROJD.zip to Drive %1, any key
  247.     pause > nul
  248.     copy c:\backup\BIGPROJD.zip %1 > NUL
  249.     goto end
  250.  
  251.     :noDrive
  252.     echo Drive not specified
  253.     echo Backup [a:/b:] [/DATA]
  254.     :end
  255.  
  256.     *----------------------------------------------------------------
  257.  
  258.     RESTORE.BAT             used to restore project to current directory
  259.  
  260.     IMPORTANT:    I've had some problems using PKUNZIP when including
  261.                 pathnames on the files to extract. You may want to
  262.                 change this batch file to change to the data directory
  263.                 before calling PKUNZIP, and changing back to your
  264.                 project directory.
  265.  
  266.     Syntax:     RESTORE [A: / B:]
  267.  
  268.     @Echo Off
  269.     REM Restore Batch File created by PwrMake on 07/04/92
  270.     if (%1)==() goto nodrive
  271.  
  272.     REM    Next section uses CheckVol to verify the disk is correct
  273.     REM    You can use the DOS Label or Nortons VL command to put
  274.     REM    a volume label on a disk
  275.     :checkdisk
  276.     checkvol %1BIGPROJ
  277.     if errorlevel 1 goto wrong
  278.     goto continue
  279.     :wrong
  280.     Echo BIGPROJ disk not found in Drive %1
  281.     pause
  282.     goto checkdisk
  283.  
  284.     :continue
  285.     if not exist c:\backup\NUL echo Creating c:\backup\ directory
  286.     if not exist c:\backup\*.* if not exist c:\backup\NUL md c:\backup
  287.     if not exist %1BIGPROJ.zip goto nofile
  288.     Echo Restoring BIGPROJ system from Drive %1
  289.     copy %1BIGPROJ.zip c:\backup\BIGPROJ
  290.     Echo Only files newer than existing files will be restored
  291.     pkunzip -n c:\backup\BIGPROJ
  292.  
  293.     REM Check if data should be backed up
  294.     if (%2)==() goto end
  295.     if (%2)==(/DATA) goto data
  296.     if (%2)==(/data) goto data
  297.     goto end
  298.  
  299.     :DATA
  300.     Echo Restoring DBF/NTX files
  301.     :CheckData
  302.     if not exist %1BIGPROJD.zip goto NoData
  303.     copy %1BIGPROJD.zip c:\backup\BIGPROJD.zip > nul
  304.     pkunzip -n c:\backup\BIGPROJD c:\data\*.dbf c:\data\*.ntx
  305.     goto end
  306.  
  307.     :NoData
  308.     echo Data File %1BIGPROJD.zip not found
  309.     echo Insert Data Disk and press a key
  310.     pause > nul
  311.     goto CheckData
  312.  
  313.     :nofile
  314.     echo BIGPROJ.zip not found on Drive %1
  315.     goto end
  316.  
  317.     :noDrive
  318.     echo Drive not specified
  319.     :end
  320.  
  321. RESTRICTIONS
  322. ────────────
  323.  
  324.     -    Currently only supports the BLINKER linker. I could have
  325.         written the RTLINK file instead with an '/l' switch, but
  326.         I got tired of typing.
  327.  
  328.     -    Cannot maintain (.rmk) and (.lnk) files. It would be nice
  329.         any customization to Pwrmake'd files wouldn't be lost. I
  330.         use my own development library which I have to add into
  331.         the allocate section of the link file.
  332.  
  333.     -    Assumes all needed (.exe) files are in the path.
  334.  
  335. SUMMARY
  336. ───────
  337.  
  338.     This software is an original work by Clifford Wiebe and is released
  339.     into the public domain without restrictions. It cannot be sold for
  340.     any purpose, but it can be given away freely. The software is
  341.     supplied as is without any explicit or implied warranty of any kind.
  342.     All risks associated with using this software are yours.
  343.  
  344.     Clifford Wiebe will not be liable for any special, incidental,
  345.     consequential, indirect or similar damages due to the loss of
  346.     data, loss of business profits, business interruption or any other
  347.     reason, even if Clifford Wiebe has been advised of the possibility
  348.     of such damages.
  349.  
  350.     That's about it. The program was trivial to write, mostly a typing
  351.     excercise, but I've found it has saved me some time. It is especially
  352.     useful to create the support files for projects that don't currently
  353.     use rmake. I
  354.  
  355.