Compile only changed files when doing 'make'?

I'm working on a Renesas supplied port of U-Boot, and it seems that 'make' always compiles every single (configured) source file instead compiling only the source files that have been changed since the previous 'make'. I've never run into this before on projects that use 'make', and it makes development of U-Boot rather grueling.
Is that due to something Renesas broke?
Or is that a "feature" of the standard U-Boot Makefile?
-- Grant

On Tue, Jan 25, 2022 at 03:50:43PM -0000, Grant Edwards wrote:
I'm working on a Renesas supplied port of U-Boot, and it seems that 'make' always compiles every single (configured) source file instead compiling only the source files that have been changed since the previous 'make'. I've never run into this before on projects that use 'make', and it makes development of U-Boot rather grueling.
Is that due to something Renesas broke?
Or is that a "feature" of the standard U-Boot Makefile?
So, it partly depends on what version of U-Boot that you're working on top of. It's still to me a relatively recent set of improvements that fix a number of reproducible build changes and so that with a constant SOURCE_DATE_EPOCH nothing is rebuilt that hasn't changed, and so it's also true that re-running "make" only rebuilds the few files that would change due to time stamp usage, which has also been corrected.

On 2022-01-25, Grant Edwards grant.b.edwards@gmail.com wrote:
I'm working on a Renesas supplied port of U-Boot, and it seems that 'make' always compiles every single (configured) source file instead compiling only the source files that have been changed since the previous 'make'.
This problem appears to be caused by an incompatibility between the Kbuild infrastructure2 and GNU make-4.3. Switching to make-4.2.1 solved the problem.
The U-Boot source tree we're using is the v2017.01 branch. It's the latest supported by the Renesas board support files. I'm not very happy they haven't contributed the supported upstream to make it easier to support newer versions. I've asked Renesas about this, and they have no plans to either support a newer version of U-Boot or contribute their support files. :/
I assume that this Kbuild incompatibility with make-4.3 has been fixed in newer versions of U-Boot.
If this Kbuild problem is familiar to anybody, and you know where the fix was made, I'd appreciate a pointer so that I can back-port that fix to my v2017.01 sources.
Thanks...
-- Grant
participants (2)
-
Grant Edwards
-
Tom Rini