Maintaining archives with makefile (MORE INFO)

Maintaining archives with makefile (MORE INFO)

Post by Donald S. Hear » Fri, 22 Mar 1991 08:41:13



     I would like to add that I would prefer that all source files
     in that directory would attempt to compile. The reason that I
     chose to over-ride the default .c.a macro was that if one source
     file has an error while compiling, the make will stop. I do not
     want to put a "-" before my compile statement, though, because
     I do not want the archive to make if any of the source files
     did not compile.

     I realize that this is probably an impossible task, but if anyone
     has a suggestion, I am all ears!!!

                                          Thanks!
                                          Don Hearth
--
***************************************************************************

*  UNIFY Corporation       *                                              *
*  Sacramento, CA          *   Go 49ers, A's, and LA Kings!               *

 
 
 

1. Maintaining archives with makefiles

    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?

--
***************************************************************************

*  UNIFY Corporation       *                                              *
*  Sacramento, CA          *   Go 49ers, A's, and LA Kings!               *

2. Video modes in X

3. Help on Makefiles and using/maintaining user libraries

4. Finding out the Unix Kernel Parameters

5. Maintaining a function library: sample Makefile wanted

6. Salary Survey Results

7. How do I maintain debug info in shared libs?

8. Mounted hard drives don't show up on NFS clients.

9. How to maintain groups, chfn info, and still use YP

10. makefiles for archived & shared libs

11. REQ: Info on Linux Makefiles

12. Info on make and makefiles

13. SCCS and Archiving, request for ideas/info