Re: How to do it w/ "make" ?
Posted in 1996
Joao Natal wrote: > <snipped for brevity> > The Problem: > > What we really want is to discard the shell script we're using and > pass on this work to "make". The main reason is that the script isn't > aware of the "make" rules, nor it sees if the target is updated, > causing among other things, to all modules being recompiled. > Time to move into source code control with software like RCS, or PVCS, or whatever... This will probably solve your problem... You can set up a "pure" directory of production source the way you want this way, and check-in/check-out your code. RCS is freeware from GNU, and is extremely simple to use, however it may be a desire of yours to build some wrappers. Wrappers are scripts that customize the commands. RCS' biggest deficiency is that you have to create a few scripts to make the commands a little less tedious. The default mode creates RCS directories under each directory where source code is, for example: /source/project1/acct/ /RCS /source/project1/bom/ /RCS /source/project2/gl/ /RCS /source/project3/pers/ /RCS This can get crazy, trying to manage source code. It's a no brainer for the developer, but does not allow a central depository for the source. The rcs commands are easy if you use this default set-up, but do not allow control for multi-developer projects. The way you would really want to do it would be: /source/projects/project1/RCS /project2/RCS /source/project1/acct/ /bom /source/project2/gl /source/project3/pers OR for the RCS: /source/projects/RCS if none of the projects have overlapping names on source modules. When working on project, you would simple set your RCS environment variable to point to the right RCS directory, then whenever you want source in/out from there, you would use a wrapper for the check-in/check-out. The key here is not how your project directories are set up--they can remain however you want--but how you set up the central repository of RCS. Wrappers divert the source to the central depository instead of the directory beneath the development directory. With a little time setting it up, it is well worth the price. The environment variable RCS is not needed in the rcs programs, but in the wrappers you write. It is the pointer to the central rcs directory. You could use ANY environment variable, example: FOO_FOO=/source/projects/project1/RCS; export FOO_FOO A check-out-a-file-with-a-lock wrapper ( going from memory, watch out!) #!/bin/sh PRG_SRC=$1 co -l $FOO_FOO/$PRG_SRC Get the book Applying RCS and SCCS from O'reilly. If you want a professional version of RCS, get something like PVCS, which has a lot of configuration management built-in. I recently wrote a few scripts to convert some source code from SCCS to RCS, so learned a lot about it. The green UNIX in a nutshell book also has info not found in the above book... Best of success to you... Tim -- \\\\|// (6 6) -----------oOOo---( )---o00o------------------------------- Tim Schaefer Motorola: tschaefe@paging.mot.com Worldwide: tschaefe@shadow.net Homepage: http://www.shadow.net/~tschaefe Liberty: www.lp.org www.cato.org -----------------------------------------------------------