[PATCH 1/2] build: add -MP for generated dependencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When an header file is removed, or more often when
bisecting or more generaly when we checkout an older
version where some header file didn't exist yet,
we typically have generated .d files containing
dependencies on a non-existing header file. In this
case, make abort and complains about the dependencies
that can't be met.

Avoid this situation by using the '-MP' option so that GCC
can automatically add a dummy rule for those header file.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index dab38aacd..a36a3d9a3 100644
--- a/Makefile
+++ b/Makefile
@@ -99,10 +99,10 @@ EXTRA_OBJS += compile-i386.o
 
 # Can we use GCC's generated dependencies?
 HAVE_GCC_DEP:=$(shell touch .gcc-test.c && 				\
-		$(CC) -c -Wp,-MD,.gcc-test.d .gcc-test.c 2>/dev/null && \
+		$(CC) -c -Wp,-MP,-MD,.gcc-test.d .gcc-test.c 2>/dev/null && \
 		echo 'yes'; rm -f .gcc-test.d .gcc-test.o .gcc-test.c)
 ifeq ($(HAVE_GCC_DEP),yes)
-cflags += -Wp,-MD,$(@D)/.$(@F).d
+cflags += -Wp,-MP,-MD,$(@D)/.$(@F).d
 endif
 
 # Can we use libxml (needed for c2xml)?
-- 
2.16.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux