home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sun / misc / 3367 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.2 KB  |  44 lines

  1. Newsgroups: comp.sys.sun.misc
  2. Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ysu.edu!malgudi.oar.net!chemabs!lwv26
  3. From: lwv26@cas.org (Larry W. Virden)
  4. Subject: Sun make rules for libraries?
  5. Message-ID: <1992Jul28.182912.6845@cas.org>
  6. Sender: usenet@cas.org
  7. Reply-To: lvirden@cas.org (Larry W. Virden)
  8. Organization: Nedriv Software and Shoe Shiners, Uninc.
  9. Date: Tue, 28 Jul 1992 18:25:47 GMT
  10. Lines: 32
  11.  
  12.  
  13. I am working on a make file.  In this makefile, I have a variable called
  14. OBJS which is set to a series of .o file names.  I want to put these
  15. .o files into a library.  I am trying to figure out what I need to put
  16. into my makefile.  Here is what I have now:
  17.  
  18. OBJS=\
  19. file1.o \
  20. file2.o \
  21. file3.o 
  22.  
  23. libabj.a:    libabj.a (${OBJS})
  24.     $(AR) $(ARFLAGS) $@ $?
  25.     $(RANLIB) $@
  26.  
  27. libabj.a(%.o): %.o
  28.     @true
  29.  
  30. which is patterned after the make command doc.
  31.  
  32. What I get is:
  33. make: Warning: Infinite loop: Target `libabj.a' depends on itself
  34. make: Fatal error: Don't know how to make target `(file1.o)'
  35.  
  36.  
  37. Can someone show me my mistake?
  38.  
  39. -- 
  40. Larry W. Virden            UUCP: osu-cis!chemabs!lvirden
  41. Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
  42. Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
  43. America Online: lvirden@aol.com
  44.