home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / PJ110.ZIP / CBACK.EXE / PJ.MAN < prev    next >
Text File  |  1994-02-24  |  21KB  |  438 lines

  1.                                         PJ User's Manual
  2.  
  3.                                            Revision A
  4.                                         February 23, 1994
  5.  
  6.                                   Copyright (C) 1994 MICROTOOLS Introduction
  7.  
  8. PJ is a simple source file manager for use on moderate size software
  9. projects (20 - 5,000 source files) utilizing a shared project library with 1-
  10. 20 programmers.  
  11.  
  12. PJ is intended to solve the following problems:
  13.  
  14.     Avoid costly collisions between programmers modifying the same
  15.         file.
  16.  
  17.     Eliminate programmer maintenance when extracting and adding files
  18.         from and to a library.
  19.  
  20.     Prevent loss of work by maintaining multiple versions of the same
  21.         file in a library.  Older versions of the same file can be retrieved.
  22.  
  23.  
  24. What PJ provides:
  25.  
  26.     ■   Library check out control - only one programmer can have a
  27.            source file out for modification at a time.
  28.     ■   Automatic updating of Make and Library command files -
  29.            when the programmer puts a new module into the library, the
  30.            Make and Library command files can be automatically updated
  31.     ■   Automatic insertion/removal with the programmers Make
  32.            file(s) - when the programmer removes a source file from a
  33.            library, the programmers local Make file is updated to allow
  34.            the programmer to modify the file and reference it in their
  35.            local directory.  When the file is put back in the library, the
  36.            local Make file is updated to remove the file.  Additional files
  37.            can be deleted from the local directory.
  38.     ■   Automatic "BAK" versions of up to 1000 files per library - PJ
  39.         allows you to keep up to 1000 "bak" versions of library files per
  40.         library.
  41.  
  42.     
  43. Description of the Development Environment
  44.  
  45. PJ was developed for a medium scale two programmer software project
  46. developing four similar embedded systems (approximately 40,000 lines
  47. of code in 1000 modules).  Borland C++ was used for the development
  48. cycle.  A Novell network server was used as the source library. 
  49. However PJ is flexible enough to allow utilization in many other
  50. environments (Including MicroSoft C/C++).  Each programmer had
  51. their own working directory with a baseline Make file.  Within the
  52. programmer's working directory, one of the four systems could be built
  53. at a time.  Additional working directories could be used if simultaneous
  54. development of the four systems was required.
  55.  
  56. Several different directories housed the source library files.  The
  57. programmer did not need to know which library he was removing the
  58. file from (this assumes that no two files are named the same for a given
  59. system).  
  60.  
  61. Associated with each library directory, is a Make file and a Library
  62. command file (You can configure these differently).  When a new file is
  63. added by a programmer to the library, the Make file and library
  64. command file is updated.
  65.  
  66. This manual is written assuming you understand the concepts of source
  67. file librarians and make utilities.  The examples given utilize Borland
  68. C++ 3.1 MAKE and TLIB formats.
  69.  
  70. Registration Benefits
  71.  
  72. If you register PJ for $25, in addition to a "no nag" version, a printed
  73. manual, unlimited technical support, and free upgrade policy, we will
  74. also provide the source code (in Borland C++ version 3.1 format) for
  75. the source file manager (source code for the automatic backup will not
  76. be provided).  This will allow you to modify PJ to meet any unforseen
  77. requirements.
  78.  
  79. Using PJ
  80.  
  81. Removing Files from the library
  82.  
  83. From the programmer's working directory, a file can be removed from
  84. the library with the following command:
  85.  
  86.         pj - FILENAME
  87.  
  88.         where FILENAME specifies the name of the file(s) to remove
  89.            from the program library.  This specification may include
  90.            wildcards and need not specify the extension.  PJ will search
  91.            all of the library directories specified in PJ.CFG for a match
  92.            of the filename (with the configured extension).  The file will
  93.            be marked read only in the library.
  94.  
  95. If the file has already been extracted, the following message will be
  96. displayed:
  97.  
  98.     Unable to extract FILENAME.EXT - File already extracted
  99.  
  100. If the file cannot be found in the library, the following message will be
  101. displayed:
  102.  
  103.     Unable to find file FILENAME
  104.  
  105. To remove a file without modifying the files specified in the PJ.CFG
  106. (for example to remove an .H file), the user should specify the file
  107. extension (and that file extension should not be in the PJ.CFG).  PJ will
  108. search all of the libraries specified in PJ.DIR and attempt to find the file
  109. specified.  When this file is returned to the library, the corresponding
  110. files (for example the Make file) will not be modified.
  111.  
  112. Inserting Files into the library
  113.  
  114. From the programmer's working directory, a file can be added to the
  115. library with the following command:
  116.  
  117.         pj + FILENAME
  118.  
  119.         where FILENAME specifies the name of the file(s) to add to the
  120.            program library.  This specification may include wildcards and
  121.            need not specify the extension.  PJ will search all of the
  122.            library directories for a match of the filename and add it to
  123.            one or more of the defined libraries.  If FILENAME is not
  124.            specified, all files extracted by the programmer will be
  125.            returned to their respective libraries.
  126.  
  127. If the file has not been extracted, the following message will be
  128. displayed:
  129.  
  130.     Unable to add FILENAME - File not in EXT_LIST.DIR; Use full
  131.         path for new files
  132.  
  133. If a new file is being added to the library, the user should specify the
  134. full filename (including path and extension).  This will place the new file
  135. in the library specified by the path and modify the files specified in
  136. PJ.CFG.
  137.  
  138. Restarting a file in your Local Directory
  139.  
  140. Sometimes (although we hope, not very often), you remove a file from a
  141. library, make a fix, test the fix and find that you don't want to put the
  142. modified file back in the library.  The * command, allows you to take
  143. the file specified in the library and overwrite your changes in your local
  144. directory.  This can be a dangerous operator if not used properly.  
  145.  
  146. Library BAK files
  147.  
  148. PJ provides a powerful tool for maintaining up to 1000 old versions of
  149. files in a given library through inclusion of MICROTOOLS ComeBack
  150. program (See the ComeBack user manual in the Appendix of this
  151. document - COMEBACK.MAN).  ComeBack can be configured to
  152. maintain the last 1000 files that were deleted and overwritten for a given
  153. Drive.  If you configure your source library as a drive (using the
  154. network mapping function or DOS SUBST), each library can be
  155. configured to protect your source files.  Using ComeBack's configuration
  156. program, (CBCONFIG), you can specify what drives you desire to
  157. include and what files you desire to have protected (For example,
  158. ComeBack can be configured to only protect .CPP, .H, .MAK and .BLD
  159. files).
  160.  
  161. An older version of a file can easily be retrieved using the COMEBACK
  162. program.
  163.  
  164. Configuring PJ
  165.  
  166. Configuring PJ requires the programmer to set up the following files:
  167. (NOTE: All configuration file lines are limited to 200 characters each)
  168.  
  169.     PJ.DIR            This file defines the library files and the associated
  170.                       extensions used in the project.  For example, let's
  171.                       assume that you have four libraries on your H:
  172.                       drive entitled: COMMON, ENGINE, MAIN and
  173.                       RATES.  In the first three libraries, .CPP files are
  174.                       kept.  In the RATES directory, .RAT, .RT1, .RT2,
  175.                       .RM1 and .RM2 files are kept.  The PJ.DIR file
  176.                       would look like:
  177.  
  178.                                     h:\common\*.cpp
  179.                                     h:\engine\*.cpp
  180.                                     h:\MAIN\*.cpp
  181.                                     h:\rates\*.rat
  182.                                     h:\rates\*.rt1
  183.                                     h:\rates\*.rt2
  184.                                     h:\rates\*.rm1
  185.                                     h:\rates\*.rm2
  186.  
  187.                        This file is limited to 200 entries
  188.  
  189.     PJ.CFG             This file tells PJ what to do with a file when it is
  190.                        extracted from and returned to the library. 
  191.                        Multiple lines can be used to define each operation. 
  192.                        For example, one file may need to be modified in
  193.                        several places in different ways during an extract. 
  194.                        Thus two entries would be required.  For example,
  195.                        in our configuration, when a file is extracted from
  196.                        a library, we want it to be inserted in the local
  197.                        directory's make file.  We need to tell PJ what file
  198.                        to modify (in our case, the make file), and where
  199.                        in the make file to insert the file.  We need to tell
  200.                        PJ how to insert the file into the make file (a Prefix
  201.                        and a Suffix to the line).  Each item is delimited by
  202.                        a comma.  If a comma is desired on the command
  203.                        line, it should be prefaced with a double quote ("). 
  204.  
  205.                        When a file is extracted or returned by PJ, the
  206.                        following line is added to specified file:
  207.  
  208.                        PREFIXFileExtractedSUFFIX
  209.  
  210.                        Thus the PJ.CFG file consists of a definition of the
  211.                        extract (-) or replace (+) operator:
  212.  
  213. OPERATOR,FILENAME,PREFIX,SUFFIX,AFTER HERE
  214. STRING,.EXT,.EXT,...etc
  215.  
  216.                        where:
  217.                               OPERATOR is the definition operator
  218.                                     (either a + or a -)
  219.                                     -  operators are used to extract files
  220.                                        from a library and specify how to
  221.                                        modify files in your local directory
  222.                                        for both - and + operators.
  223.                                     +  operators are used to put files back
  224.                                        into the library and to specify how
  225.                                        to modify files in the library's
  226.                                        directory when the + operator is
  227.                                        used to add a new file.
  228.                               FILENAME is the name of the file to
  229.                                     modify (in our case - the make file). 
  230.                                     For the + operator, if only an
  231.                                     extension is used (.MAK for
  232.                                     example), the filename of the library
  233.                                     directory will be used for the
  234.                                     filename.  For example, if the
  235.                                     programmer is inserting a new file
  236.                                     into the COMMON directory, the
  237.                                     COMMON.MAK file will be updated.
  238.                               PREFIX is the comma delimited string to go
  239.                                     on the line being added to
  240.                                     FILENAME before the file being
  241.                                     extracted       is added to the line
  242.                               SUFFIX is the comma delimited string to go
  243.                                     on the line being added to
  244.                                     FILENAME after the file being
  245.                                     extracted       is added to the line
  246.                               AFTER HERE STRING is the comma
  247.                                     delimited string to tell PJ where to
  248.                                     insert the line being added to
  249.                                     FILENAME.  PJ searches
  250.                                     FILENAME for the AFTER HERE
  251.                                     STRING, and inserts the line after this
  252.                                     line.  If not specified, PJ inserts the
  253.                                     file at the beginning of FILENAME.
  254.                               EXT is the extension of the files that can be
  255.                                     automatically extracted/returned
  256.                                     without specifying the extension as
  257.                                     well as the files that will be inserted
  258.                                     into the FILENAME.  Files with
  259.                                     extensions not part of this list will
  260.                                     result in the file being
  261.                                     extracted/returned but FILENAME
  262.                                     will not be updated.  For example, .C
  263.                                     and .CPP files will be included in this
  264.                                     list, because these are source files to
  265.                                     be included in the local make. 
  266.                                     However, .H files will not be included
  267.                                     as these files can be removed from the
  268.                                     library but the make file need not be
  269.                                     modified.  Up to twenty extensions
  270.                                     can be configured on each line.
  271.                
  272.                       For example, with our Borland C++ compiler, our
  273.                       first extract line in PJ.CFG looks as follows:
  274.                       
  275.         -,makefile,,.OBJ \,$(MARK_1)
  276.                   
  277.                       If multiple entries are required, a second extract
  278.                       definition line can be defined.  Our second line
  279.                       looks as follows:
  280.  
  281.         -,makefile,, +,$(MARK_2)
  282.  
  283.                       The $ character is used in the Borland make file to
  284.                       indicate a macro (which in our case is not defined). 
  285.                       Those lines are inserted in the makefile.  The
  286.                       following represents a sample makefile:
  287.  
  288. ####################### BORLAND C++ MAKEFILE
  289. #######################
  290. lsw = /v /c  /m /s
  291. csw = 
  292. cppmodel = -ml
  293.  
  294. DRIVE = H
  295.  
  296. .cpp.obj:
  297.         bcc $(csw) -zEtest_seg $(cppmodel) {$< }
  298.  
  299. .rm2.obj:
  300.         bcc $(csw) $(cppmodel) -zEmenu_seg {$< }
  301.  
  302. .rm1.obj:
  303.         bcc $(csw) $(cppmodel) -zEmenu_seg {$< }
  304.  
  305. .rat.obj:
  306.         bcc $(csw) $(cppmodel) -zErat_seg {$< }
  307.  
  308. .rt1.obj:
  309.         bcc $(csw) $(cppmodel) -zErat_seg {$< }
  310.  
  311. .rt2.obj:
  312.         bcc $(csw) $(cppmodel) -zErat_seg {$< }
  313.  
  314. .precious: MAIN.exe
  315.  
  316. MAIN.exe: makefile \
  317. $(DRIVE):\MAIN\MAIN.lib \
  318. $(MARK_1) \
  319. TASKINIT.obj 
  320.            tlink $(lsw)  @&&!
  321. c0l +
  322. $(MARK_2) +
  323. TASKINIT +
  324. , MAIN, MAIN, $(DRIVE):\MAIN\MAIN + $(DRIVE):\MAIN\COMMON
  325. $(DRIVE):\MAIN\rates +
  326. $(DRIVE):\MAIN\engine 
  327. !
  328. #End##################### BORLAND C++ MAKEFILE
  329. #######################
  330.  
  331.                        The return operator works in a similar fashion. 
  332.                        Files can be modified in the directory from which
  333.                        the module came using the same syntax. This
  334.                        operation only occurs when a new file is being
  335.                        inserted into the library (i.e. when the programmer
  336.                        specifies the path).  In our environment, the return
  337.                        operator specification in PJ.CFG modifies a make
  338.                        file used to compile the library modules as well as
  339.                        a library command file to insert the files into the
  340.                        library.  Files that are listed for modification that
  341.                        do not exist in the directory will not be created nor
  342.                        will an error be generated.  This allows the
  343.                        programmer to have multiple make files for a given
  344.                        library.
  345.  
  346.                        In our environment, each library has a .MAK
  347.                        associated with it and a .BLD associated with it. 
  348.                        The .MAK is used to compile the modules.  The
  349.                        .BLD is used to insert the .OBJs into the library. 
  350.                        The PJ.CFG definition in this case would appear as
  351.                        follows:
  352.  
  353.                        +,.MAK,,.OBJ \,$(MARK_1),.CPP,.C,.ASM
  354.                        +,.BLD,+ ,.OBJ &,,.CPP,.C,.ASM
  355.  
  356.                        The following defines a simple TLIB .BLD file:
  357.  
  358.                                +ACCESS   &
  359.                                +DO_EVENT &
  360.                                +DSP_OBJ  &
  361.                                +DSPERROR &
  362.                                +DSPFUNCS &
  363.                                +PASSWORD &
  364.                                +Q_EVENT  &         
  365.                                +SOFT_KEY &
  366.                                +STATE_EN &
  367.                                +
  368.  
  369.                        In addition to the extract (-) and return (+)
  370.                        operators, there is one additional operator (*).  The
  371.                        * operator in  the PJ.CFG file defines what file
  372.                        extensions should be deleted when a file is removed
  373.                        from the local library (with the + operator).  For
  374.                        example, when a .CPP file is returned to the
  375.                        library, .OBJ, .BAK, and .ERR files should be
  376.                        deleted.   Up to twenty extensions can be defined
  377.                        with the * operator.   This would be specified in
  378.                        PJ.CFG as follows:
  379.  
  380.                              *,.OBJ
  381.                              *,.BAK
  382.                              *,.ERR
  383.  
  384.                       In summary, for a Borland C++ development
  385.                       environment, we would have the following PJ.CFG:
  386.  
  387.                       -,makefile,,.obj \,$(MARK_1),.cpp,.asm,.c
  388.                       -,makefile,, + ,$(MARK_2),.cpp,.asm,.c
  389.                       +,.mak,,.obj \,$(MARK),.cpp,.asm,.c,.cas
  390.                       +,.bld, + , &,,.cpp,.asm,.c,.cas
  391.                       *,.obj
  392.                       *,.err
  393.  
  394.                       Line 1  When you extract a file, modify the file
  395.                               MAKEFILE every time a .CPP, .ASM, or
  396.                               a .C file is extracted.  After the first
  397.                               occurrence of $(MARK_1) in MAKEFILE,
  398.                               on the next line, insert the file name being
  399.                               extracted with no prefix and with a:
  400.                                     .obj \
  401.                               suffix.  
  402.  
  403.                       Line 2  When you extract a file, modify the file
  404.                               MAKEFILE every time a .CPP, .ASM, or
  405.                               a .C file is extracted.  After the first
  406.                               occurrence of $(MARK_2) in MAKEFILE,
  407.                               on the next line, insert the file name being
  408.                               extracted with no prefix and with a:
  409.                                     +
  410.                               suffix.
  411.  
  412.                       Line 3  When you place a new file (with a .cpp,
  413.                               .asm,.c,.cas extension) back in the library
  414.                               (by specifying the path and extension),
  415.                               modify the library_name.mak file as
  416.                               follows:  After the first occurrence of
  417.                               $(MARK_1) in library_name.mak file, on
  418.                               the next line, insert the file name being
  419.                               extracted with no prefix and with a:
  420.                                     .obj \
  421.                               suffix.  
  422.  
  423.                       Line 4  When you place a new file (with a .cpp,
  424.                               .asm,.c,.cas extension) back in the library
  425.                               (by specifying the path and extension),
  426.                               modify the library_name.bld file as follows: 
  427.                               At the beginning of the file,  insert the file
  428.                               name being extracted with a + prefix  and
  429.                               with an & suffix.  
  430.  
  431.                       Line 5  When a replace operator is used with
  432.                               FILENAME, delete the FILENAME.OBJ
  433.                               file in the local directory.
  434.  
  435.                       Line 6  When a replace operator is used with
  436.                               FILENAME, delete the FILENAME.ERR
  437.                               file in the local directory.
  438.