Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84 chuqui version 1.9 3/12/85; site unisoft.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!dual!unisoft!fnf From: fnf@unisoft.UUCP Newsgroups: net.unix Subject: Re: Problem with Make Message-ID: <512@unisoft.UUCP> Date: Wed, 24-Jul-85 14:44:53 EDT Article-I.D.: unisoft.512 Posted: Wed Jul 24 14:44:53 1985 Date-Received: Sat, 27-Jul-85 02:27:15 EDT References: <145@iitcs.UUCP> <165@husky.uucp> <723@lsuc.UUCP> Reply-To: fnf@unisoft.UUCP (Fred Fish) Organization: UniSoft Systems, Berkeley Lines: 37 In article <723@lsuc.UUCP> dave@lsuc.UUCP (David Sherman) writes: >> how do you make objects INSIDE archives depend on their >> sources (so the objects don't have to keep lying around)? > >Here's a usable makefile, stripped down from one of our system makefiles: There are a couple of bugs in your example, no "-c" in the $(CC) line and no objects to archive in the ar line. A partial solution to this problem is found in the "AUGMAKE" section of the system V Support Tools Guide. Unfortunately, the example there is missing a couple of critical lines to suppress the built in rule that augmake (augmented make) has for maintaining archives. A correct example (for system V with the new augmented make) follows: .SUFFIXES: .a .c # Suppress built in rule, VERY important. .c.a:; LIB = lib.a $(LIB): $(LIB)(file1.o) $(LIB)(file2.o) $(CC) -c $(CFLAGS) $(?:.o=.c) ar rv $@ $? rm $? Note that the built in rule is EXTREMELY SLOW for large archives since it does each object (compile, replace in archive) one at a time. This one does all the compilations first then replaces all the out of date objects in one ar operation. -Fred =========================================================================== Fred Fish UniSoft Systems Inc, 739 Allston Way, Berkeley, CA 94710 USA {ucbvax,decvax}!unisoft!fnf (415) 644 1230 TWX 11 910 366-2145 ===========================================================================