Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!rutgers!princeton!rocksvax!rocksanne!mayer From: mayer@rocksanne.UUCP (Jim Mayer) Newsgroups: comp.unix.wizards Subject: Re: RCS vs. SCCS and make Message-ID: <392@rocksanne.UUCP> Date: Thu, 18-Jun-87 10:42:50 EDT Article-I.D.: rocksann.392 Posted: Thu Jun 18 10:42:50 1987 Date-Received: Sun, 21-Jun-87 13:52:49 EDT References: <41@esosun.UUCP> <20393@sun.uucp> <42@loki.esosun.UUCP> <2615@ncoast.UUCP> Reply-To: mayer@rocksanne.UUCP (Jim Mayer) Organization: Xerox Corp., Webster, NY Lines: 70 Another way to use RCS with make is to: 1. Make all dependencies explicit in the makefile. The best way is to generate them automatically with one of the "make depends" hacks that are floating around the network. On 4.3 systems you can use "cc -M" to generate a list of dependencies. 2. Add a ".DEFAULT" entry to your makefile that tries to check out the "to be made" file. This scheme works even with the use of an RCS directory. For example, under 4.3 you can use: ----------------------- START OF EXAMPLE ------------------------ depends: all your source files mv -f Makefile Makefile.orig (sed -e '/^#DEPENDS/,$$d' Makefile.orig ; \ echo "#DEPENDS" ; \ cc -M $(CFLAGS) $$< \ ) > Makefile .DEFAULT: co -q $@ ------------------------ END OF EXAMPLE ------------------------- If you don't have "cc -M", you can replace it with call to the following shell script (cc -E just invokes "cpp"): ----------------------- START OF SCRIPT ------------------------ #! /bin/sh # # Produce a list of object file dependencies from a list of sources. # # depends [options] name... # options= while true do case "${1-xxx}" in -I|-o) options="$options $1 ${2?No second argument for -I}" shift; shift ;; -*) options="$options $1" shift ;; *) break ;; esac done for file in $@ do object=`expr "$file" : "\(.*\)\..*"`.o if test ".o" = "$object" then object="$file.o" fi cc $options -E $file | sed -n -e "s/^# 1 \"\(.*\)\"\$/$object: \1/p" done ------------------------ END OF SCRIPT ------------------------- -- Jim -- (Grapevine) mayer.wbst (Arpa) mayer.wbst@Xerox.com (NS) mayer:wbst128:xerox (Phone) (716) 422-9407 (UUCP) {seismo|allegra}!rochester!rocksanne!mayer