On 13/09/2023 09.29, David Woodhouse wrote:
From: David Woodhouse <dwmw@xxxxxxxxxxxx>
The -MP flag instructs the compiler to emit phony targets for each header
file that it lists as a dependency, so that if a header file is *absent*
from the next build (because it's been deleted and the C file no longer
includes it), the build doesn't gratuitously fail when make thinks it's
needed and can't work out how to create it.
Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e7998a4..101c028 100644
--- a/Makefile
+++ b/Makefile
@@ -90,7 +90,7 @@ CFLAGS += $(wmissing_parameter_type)
CFLAGS += $(wold_style_declaration)
CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes
-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
+autodepend-flags = -MMD -MP -MF $(dir $*).$(notdir $*).d
LDFLAGS += -nostdlib $(no_pie) -z noexecstack
Tested-by: Thomas Huth <thuth@xxxxxxxxxx>
Thanks, I've pushed it to the repository now!