rules for RCS in make

Christopher JS Vance cjsv at ccadfa.adfa.oz.au
Fri Mar 16 16:14:15 AEST 1990


rosalia at max.sunysb.edu (Mark Galassi) writes:

>Does anyone have a rule for make, so that any .c file will depend
>on an RCS/file.c,v and it will be generated with "co file.c"?

>I can do it by hand, for every .c file, but I would much prefer to
>have a rule.  Unfortunately the rule cannot be a simple one like
>the .c from .o rule, because of the RCS/ prefix.

If you're happy to keep your RCS files in the same directory as your
object code, rather than a separate directory, the answer is fairly
straightforward.  RCS does not insist that the ,v files be in a
different directory.  I've done this, and have been reasonably happy
with the result.

|	.c,v.o:
|		$(CO) $(COFLAGS) $<
|		$(CC) $(CCFLAGS) -c $<
|		-rm -f $<

Or somethining similar (i.e., this is from non-recent memory).

If you do want to keep your files in a separate directory, you could
check whether your make understands VPATH.  I've not tried this with
RCS.  If the manual doesn't mention VPATH, it may still be there (try
strings ...).



More information about the Comp.unix.wizards mailing list