summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-01-20 16:18:08 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-01-20 16:18:08 +0100
commitb428366389ecdad457fb04e13857902e11585881 (patch)
tree536c20dc62f686cb2b87f6a80158e9101c662a1a /build
parent29c5c86e56697286a92031aaa9fdd903b3bcc426 (diff)
downloadastra-b428366389ecdad457fb04e13857902e11585881.tar.gz
astra-b428366389ecdad457fb04e13857902e11585881.tar.bz2
astra-b428366389ecdad457fb04e13857902e11585881.tar.xz
astra-b428366389ecdad457fb04e13857902e11585881.zip
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.
Diffstat (limited to 'build')
-rw-r--r--build/linux/Makefile.in3
1 files changed, 3 insertions, 0 deletions
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