On Thu, 2025-06-19 at 20:59 +0000, WaitronCharm via Bug reports and discussion for GNU make wrote: > Yes, thank you. It looks like with the 1st execution not only > included files are re-made and a 2nd execution started but also > (still in the 1st execution) other targets (targets which are not > included) also re-made by recipes now outdated. > > Is this how 'make' works?
Again I'm not completely sure I understood the question, but when make rebuilds makefiles it uses the exact same algorithm (and rule database) that it uses to build every other target. There are not two different algorithms, one used for included makefiles and one used for other targets. GNU Make basically pretends that all your makefiles are command line goals to be updated, before any other goals are considered. So, if one of your makefiles (including included makefiles) lists a target as a prerequisite, that target will be considered (and possibly rebuilt) before the makefile is considered (and possibly rebuilt). And of course, that works recursively for all prerequisites of that target, their prerequisites, etc.