diff options
| author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-01-20 16:18:08 +0100 | 
|---|---|---|
| committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-01-20 16:18:08 +0100 | 
| commit | b428366389ecdad457fb04e13857902e11585881 (patch) | |
| tree | 536c20dc62f686cb2b87f6a80158e9101c662a1a | |
| parent | 29c5c86e56697286a92031aaa9fdd903b3bcc426 (diff) | |
| download | astra-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.
| -rw-r--r-- | build/linux/Makefile.in | 3 | 
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 | 
