home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!dkuug!cri.dk!csd!mwh
- From: mwh@csd.cri.dk (Michael Wraa-Hansen)
- Newsgroups: comp.unix.questions
- Subject: Library maintenance with SunOS 4.1.1 make (bug report?)
- Message-ID: <mwh.721919816@csd.cri.dk>
- Date: 16 Nov 92 13:16:56 GMT
- Sender: news@csd.cri.dk
- Organization: Computer Resources International A/S
- Lines: 69
-
- I have been trying to use the make utility with object file library
- maintenance and I think that I have spotted a bug. I am aware that bug
- report 1010592 reports something similar, but don't think it applies here.
-
- Consider the following makefile and defaults file (I cannot use a
- solution without a defaults file):
-
- ##### Makefile
- OBJECTS=foo.o bar.o
- LIBRARY=A
-
- all: libA.a libB.a
-
- include default.mk
- ##### end Makefile
-
- ##### default.mk
- lib$(LIBRARY).a: lib$(LIBRARY).a($(OBJECTS))
- ar rv $@ $?
- ranlib $@
-
- lib$(LIBRARY).a(%.o): %.o
- @true
-
- libB.a: libB.a($(OBJECTS))
- ar rv $@ $?
- ranlib $@
-
- libB.a(%.o): %.o
- @true
- ##### end default.mk
-
- If I display (make -p) the specific dependencies for this I get the
- following (omitting irrelevant rules):
-
- ##### make output
- all: libA.a libB.a
- lib.a(%.o): %.o
- @true
- libB.a(%.o): %.o
- @true
- libA.a(%.o): %.o
- @true
- libB.a(%.o): %.o
- @true
- lib.a: lib.a()
- ar rv $@ $?
- ranlib $@
- libB.a: libB.a() libB.a(foo.o) libB.a(bar.o)
- ar rv $@ $?
- ranlib $@
- libA.a: libA.a(foo.o) libA.a(bar.o)
- ar rv $@ $?
- ranlib $@
- ##### end make output
-
- Whether using the indirect version (libA.a) or direct version (libB.a)
- make is generating wrong rules - and in the latter case this prohibits
- make from finishing it's job.
-
- Any solutions or oppinions?
-
- -Michael
- +--------------------------------------+--------------------------------------+
- | Michael Wraa-Hansen | email mwh@csd.cri.dk |
- | Computer Resources International A/S | phone +45 45 82 21 00 ext. 3224|
- | Bregnerodvej 144 | direct dial +45 45 82 22 66 + 3224 |
- | DK-3460 Birkerod, Denmark | fax +45 45 82 01 22 |
- +--------------------------------------+--------------------------------------+
-