From b428366389ecdad457fb04e13857902e11585881 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 20 Jan 2016 16:18:08 +0100 Subject: Try to improve nvcc dependency file generation We now append empty targets for all dependencies listed in the .d file generated by nvcc. This mimics the behaviour of gcc's -MP option, and prevents deleted header files from breaking the build. --- build/linux/Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 12c9e2b..f556066 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -305,6 +305,9 @@ ifeq ($(cuda),yes) @$(NVCC) $(NVCCFLAGS) -c $(<) -Xcompiler -fPIC -DPIC -o $(*D)/.libs/$(*F).o >/dev/null 2>&1 @# Generate a .d file, with target name $*.lo @$(NVCC) $(NVCCFLAGS) -M $(<) -MT $(*F).lo -odir $(*D) -o $(*D)/$(DEPDIR)/$(*F).d + @# Generate empty targets for all dependencies listed in the .d file. + @# This mimics gcc's -MP option. + @for x in `cat $(*D)/$(DEPDIR)/$(*F).d`; do if test a$$x != a: -a a$$x != a\\; then echo -e "\n$$x:\n" >> $(*D)/$(DEPDIR)/$(*F).d; fi; done @# Generate a fake libtool .lo file @echo "# $*.lo - a libtool object file" > $*.lo @echo "# Generated by" `./libtool --version | head -n 1` >> $*.lo -- cgit v1.2.3