Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site watmath.UUCP Path: utzoo!watmath!jmsellens From: jmsellens@watmath.UUCP (John M Sellens) Newsgroups: net.bugs.4bsd Subject: 4.2 Make - Bug in special macro '$?' with double colons ?? Message-ID: <8846@watmath.UUCP> Date: Mon, 3-Sep-84 17:58:46 EDT Article-I.D.: watmath.8846 Posted: Mon Sep 3 17:58:46 1984 Date-Received: Tue, 4-Sep-84 07:33:52 EDT Organization: U of Waterloo, Ontario Lines: 64 (I wouldn't be suprised if this was present in ALL makes... ) In 4.2bsd make, there seems to be a minor bug in the processing of makefiles with double colon definition lines. (The single colon case works as you would expect - seems to be treated like one big definition line). None of the files referred to in the makefile exist. The special macro '$?' gets expanded in different ways depending on the order of the items in the makefile. It seems that if a double colon definition does not have any commands, it is treated as part of the next definition (at least for purposes of determining '$?'). Repeatable as shown below. My question: Is this a bug or a feature?? I don't have a fix - to my mind, this is too obscure to really be worth the trouble. I only stumbled on it because I am trying to reproduce the behaviour of make on a PC and I wasn't sure how it was supposed to react. cat Makefile all:: one echo ONE $@ echo $? all:: two # echo TWO $@ # echo $? all:: three echo THREE $@ echo $? one: two echo $@ two: echo $@ three: echo $@ make -n -f twoNotDefined /* # comments there */ echo two echo one echo ONE all echo one echo three echo THREE all echo two three <== Notice that two is here, but one is not. <== But if you move the line containing <== 'all:: two' to after the group that starts <== 'all:: three', two no longer shows up on <== this line. make -n -f twoDefined /* #'s removed */ echo two echo one echo ONE all echo one echo TWO all echo two echo three echo THREE all echo three <== two is not here!! John M Sellens UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!jmsellens CSNET: jmsellens%watmath@waterloo.csnet ARPA: jmsellens%watmath%waterloo.csnet@csnet-relay.arpa