[comp.unix.questions] How do you get make to check out things from RCS?

haynes@ucscc.UCSC.EDU (99700000) (09/29/90)

I'm just starting to play with RCS.  How do I fix a Makefile, or hack
the make program, to get it to check out things it needs automatically
from the RCS directory?
haynes@ucscc.ucsc.edu
haynes@ucscc.bitnet
..ucbvax!ucscc!haynes

"Any clod can have the facts, but having opinions is an Art."
        Charles McCabe, San Francisco Chronicle

gt0178a@prism.gatech.EDU (JIM BURNS) (09/30/90)

in article <7310@darkstar.ucsc.edu>, haynes@ucscc.UCSC.EDU (99700000) says:

> I'm just starting to play with RCS.  How do I fix a Makefile, or hack
> the make program, to get it to check out things it needs automatically
> from the RCS directory?

'ci -l' will leave your source file intact and keep 'make' happy. Assuming
you want to save disk space tho', do a 'ci filename', then a 'touch
filename' so that make will see a datestamp to calculate dependencies
from. Then something like:

.c.o:
	-rm -f $<
	co $<
	$(CC) -c $<         # add options to flavor
	rm & touch $<       # or just echo ""> $< - just uses 1 char.

to create your .o's, and then:

target:	dependencies
	optional rm's
	cc -o $@ dependencies $(OPTIONS)
	optional chmod's
	(rm & touch) or echo> your dependencies # NOT a good idea unless
						# you expect to re-compile
						# everything everytime
						# (of course you could
						# 'ar r' them)
	optional mv your target to destination dir and 'ln -s' to it
-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a@prism.gatech.edu

gt0178a@prism.gatech.EDU (JIM BURNS) (09/30/90)

in article <14301@hydra.gatech.EDU>, I write:

> .c.o:
> 	-rm -f $<
> 	co $<
> 	$(CC) -c $<         # add options to flavor
> 	rm & touch $<       # or just echo ""> $< - just uses 1 char.

Actually, I need to add:

        touch $@

to this to put the source and .o in sync again.
-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a@prism.gatech.edu

jgd@csd4.csd.uwm.edu (John G Dobnick) (10/02/90)

From article <7310@darkstar.ucsc.edu>, by haynes@ucscc.UCSC.EDU (99700000):
> I'm just starting to play with RCS.  How do I fix a Makefile, or hack
> the make program, to get it to check out things it needs automatically
> from the RCS directory?

Mr. Burns suggests a few makeifle constructs to do this.

Another alternative is to use GNUmake (from the Free Software Foundation).
GNUmake has built-in knowledge of RCS and will perform checkouts as needed.

Available via FTP from prep.ai.mit.edu.  Probably available via anonymous
UUCP from somewhere -- I'm sure someone out there will know.
-- 

John G Dobnick  (JGD2)
Computing Services Division @ University of Wisconsin - Milwaukee
INTERNET: jgd@csd4.csd.uwm.edu             ATTnet: (414) 229-5727
UUCP: uunet!uwm!csd4.csd.uwm.edu!jgd

"Knowing how things work is the basis for appreciation,
and is thus a source of civilized delight."  -- William Safire