Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!bionet!agate!ucbvax!ucdavis!csusac!unify!hearth From: hearth@Unify.Com (Donald S. Hearth) Newsgroups: comp.unix.programmer Subject: Maintaining archives with makefiles Message-ID: <08bvvsr@Unify.Com> Date: 20 Mar 91 23:33:08 GMT Distribution: na Organization: Unify Corporation, Sacramento, CA, USA Lines: 30 I need some help. I am trying to create a makefile that will maintain an archive. Here is what I have so far: LIB=foo.a OBJECTS= \ $(LIB)(foo1.o) \ $(LIB)(foo2.o) \ $(LIB)(foo3.o) $(LIB): $(OBJECTS) $(CC) -c $(CFLAGS) $(?:.o=.c) ar crv ../../lib/$(LIB) `lorder *.o | tsort` $(RANLIB) $(LIB) rm -f *.o .c.a :; The problem with this makefile is that if foo2.c has a compiler error, after I fix the problem and rerun make, all three source files get remade. Now, for 3 source files, it is no big deal, but if there are 100 or more source files, it can be a BIG pain. Can somebody suggest a solution to this problem? -- *************************************************************************** * Donald S. Hearth * address: hearth@unify.com * * UNIFY Corporation * * * Sacramento, CA * Go 49ers, A's, and LA Kings! *