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.
|