This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Makefile.common error preventing incremental builds

At least the combination ARM gcc 9.2.0 and nRF5 SDK 16.0.0 prevents me from doing incremental builds after some source file have changed.

The problem is with wrong dependency rule generated by gcc using the -MD option. I think, that there is missing -MT option.

I have changed the line in Makefile.common:

$(NO_ECHO)$(1) -MP -MD -c -o $@ $(call get_path,$($@)) $(2) $(INC_PATHS)

to

$(NO_ECHO)$(1) -MP -MD -MT $@ -c -o $@ $(call get_path,$($@)) $(2) $(INC_PATHS)

Everything works for me now, this is just suggestion to fix it in the SDK.

Related