bugmake - Bugs: bug #8154, $? not set properly in archive...

 
 

bug #8154: $? not set properly in archive targets

Submitted by:  Paul D. Smith <psmith>
Submitted on:  Mon 15 Mar 2004 09:11:33 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.79.1Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 29 Nov 2004 02:34:12 AM UTC, comment #1:

Hm. It is not clear what the right answer is here. If a make rule does not update the target, then that target is not considered updated for parent targets. For example, this makefile:

$ cat makefile
foo: bar ; @echo '$$? = $?'
bar: ;
$ touch foo
$ make
$? =

This happens because since "bar" is not updated (doesn't exist in this case), it's not newer than "foo", so $? is empty. If you use -n make does not actually run any commands, so it ASSUMES that the target "bar" would be updated if it did run the commands, and so with -n "bar" is newer than "foo" and $? = bar.

The situation with your archives is identical: the rule you provide to build a library out of a .c file is empty and does not really build a library out of a .c file. So, when make computes the value of $? it sees that libsicom.a(parser.o) is NOT newer than libsicom.a; in fact it doesn't exist, and so $? is empty. The same situation with -n holds as above.

Offhand I don't see any good way to change make's standard behavior in this respect, so that you'd get what you expect.

Please add comments to this bug if you have questions or thoughts, and/or bring up the subject on help-make@gnu.org.

Paul D. Smith <psmith>
Project Administrator
Mon 15 Mar 2004 09:11:33 PM UTC, original submission:

This makefile:

libsicom.a: libsicom.a(parser.o) ; @echo '$$? = $?'
.c.a:;

Then:

touch parser.c
touch junk.o
ar rv libsicom.a junk.o

Then:

$ make -n
echo '$? = parser.o'

Looks correct. But:

$ make
$? =

Not correct.

Paul D. Smith <psmith>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 29 Nov 2004 02:34:12 AM UTCpsmithStatusNone=>Not A Bug
  Open/ClosedOpen=>Closed
Mon 15 Mar 2004 09:11:33 PM UTCpsmithCarbon-Copy-=>Added peter --DOT-- story --AT-- kongsberg --DOT-- com

Back to the top


Powered by Savane 3.1-cleanup1