home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13470 < prev    next >
Encoding:
Text File  |  1992-11-16  |  2.1 KB  |  80 lines

  1. Path: sparky!uunet!mcsun!sunic!dkuug!cri.dk!csd!mwh
  2. From: mwh@csd.cri.dk (Michael Wraa-Hansen)
  3. Newsgroups: comp.unix.questions
  4. Subject: Library maintenance with SunOS 4.1.1 make (bug report?)
  5. Message-ID: <mwh.721919816@csd.cri.dk>
  6. Date: 16 Nov 92 13:16:56 GMT
  7. Sender: news@csd.cri.dk
  8. Organization: Computer Resources International A/S
  9. Lines: 69
  10.  
  11. I have been trying to use the make utility with object file library
  12. maintenance and I think that I have spotted a bug. I am aware that bug
  13. report 1010592 reports something similar, but don't think it applies here.
  14.  
  15. Consider the following makefile and defaults file (I cannot use a
  16. solution without a defaults file):
  17.  
  18. ##### Makefile
  19. OBJECTS=foo.o bar.o
  20. LIBRARY=A
  21.  
  22. all: libA.a libB.a
  23.  
  24. include default.mk
  25. ##### end Makefile
  26.  
  27. ##### default.mk
  28. lib$(LIBRARY).a: lib$(LIBRARY).a($(OBJECTS))
  29.     ar rv $@ $?
  30.     ranlib $@
  31.  
  32. lib$(LIBRARY).a(%.o): %.o
  33.     @true
  34.  
  35. libB.a: libB.a($(OBJECTS))
  36.     ar rv $@ $?
  37.     ranlib $@
  38.  
  39. libB.a(%.o): %.o
  40.     @true
  41. ##### end default.mk
  42.  
  43. If I display (make -p) the specific dependencies for this I get the
  44. following (omitting irrelevant rules):
  45.  
  46. ##### make output
  47. all: libA.a libB.a
  48. lib.a(%.o):    %.o
  49.     @true
  50. libB.a(%.o):    %.o
  51.     @true
  52. libA.a(%.o):    %.o
  53.     @true
  54. libB.a(%.o):    %.o
  55.     @true
  56. lib.a: lib.a()
  57.     ar rv $@ $?
  58.     ranlib $@
  59. libB.a: libB.a() libB.a(foo.o) libB.a(bar.o)
  60.     ar rv $@ $?
  61.     ranlib $@
  62. libA.a: libA.a(foo.o) libA.a(bar.o)
  63.     ar rv $@ $?
  64.     ranlib $@
  65. ##### end make output
  66.  
  67. Whether using the indirect version (libA.a) or direct version (libB.a)
  68. make is generating wrong rules - and in the latter case this prohibits
  69. make from finishing it's job.
  70.  
  71. Any solutions or oppinions?
  72.  
  73. -Michael
  74. +--------------------------------------+--------------------------------------+
  75. | Michael Wraa-Hansen                  | email       mwh@csd.cri.dk           |
  76. | Computer Resources International A/S | phone       +45 45 82 21 00 ext. 3224|
  77. | Bregnerodvej 144                     | direct dial +45 45 82 22 66 + 3224   |
  78. | DK-3460 Birkerod, Denmark            | fax         +45 45 82 01 22          |
  79. +--------------------------------------+--------------------------------------+
  80.