Follow-up Comment #14, bug #62929 (project make): Thanks for digging this part of the manual up.
> There are two exceptions: a target starting with a period is not a default unless it contains one or more slashes, ‘/’, as well; I attempt to express this precisely in a somewhat informal modal logic form: 1. start_with_period(target) & !contains_slashes(target) => !possible[default(target)] 2. start_with_period(target) & contains_slashes(target) => possible[default(target)] 3. possible[default(target)] & is_first(target) => default(target) While this exception does explain the behavior of the examples I provided in the comment before, I don't think it explains that of this Makefile: .a: $(info 0) ./.b: # skip $(info 1) c: # choose $(info 2) 1. './.b' starts with a '.'; start_with_period('./.b') holds 2. './.b' contains one or more '/'; contains_slashes('./.b') holds It follows that './.b' should be default. Yet, 'c' is chosen. $ make -p | grep DEFAULT_GOAL .DEFAULT_GOAL := c $ ./makebin/make-4.3/make -p | grep DEFAULT_GOAL .DEFAULT_GOAL := c ---- Another thing I'd like to add is that there is another parenthetical mention that should probably be clarified. It is that in the index entry of .DEFAULT_GOAL <https://www.gnu.org/software/make/manual/html_node/Name-Index.html#Name-Index_fn_symbol-6:~:text=.DEFAULT_GOAL%20(define%20default%20goal)>, the linked 6.14 Other Special Variables item <https://www.gnu.org/software/make/manual/html_node/Special-Variables.html#index-_002eDEFAULT_005fGOAL-_0028define-default-goal_0029:~:text=name2%20%3D%20inc.mk-,.DEFAULT_GOAL,-Sets%20the%20default> which in turn links 9.2 Arguments to Specify the Goals <https://www.gnu.org/software/make/manual/html_node/Goals.html#Goals:~:text=By%20default%2C%20the%20goal%20is%20the%20first%20target%20in%20the%20makefile%20(not%20counting%20targets%20that%20start%20with%20a%20period).> it says: > By default, the goal is the first target in the makefile (not counting targets that start with a period). _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?62929> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/