OS2 Development Snippets

  1. Rule for checking out source code from RCS structure with NMAKE
  2. I currently use RCS to control my source code. All checked in files are placed in an RCS directory. The built-in rules for NMAKE are limited, but the ability to add new rules exists. What is such a rule for controlling the checking out of files which are not available? After reading the manual, posting to a newsgroup and then re-reading the manual following no response, I worked out the syntax.

    Code snippet for Makefile ...

    # define variable for RCS's co command, may be useful later
    CO=co
    
    # add file extensions need rules for
    .SUFFIXES: .c,v .h,v
    
    # rules added to support RCS
    {RCS}.c,v.obj:
    	$(CO) $<
    
    {RCS}.c,v.c:
    	$(CO) $<
    
    {RCS}.h,v.h:
    	$(CO) $<
    ... end of Makefile code snippet.

  3. Setting extended attribute file type
  4. Using RCS for source code control the extended attributes are currently lost during the update cycle, "ci" then "co" or simply "ci -l". To workaround this problem I have written a short REXX script, setccode.cmd, which will set the required attribute for a file. The script could be used either from the command line or better still as part of the rules for checking out of files. For example, extending the rules above,

    {RCS}.c,v.c:
    	$(CO) $<
    	setccode.cmd $< 

Take me home!


All comments and suggestions to John S Glover
Last modified 28 March, 1998.