Fix automatic dependency tracking
authorTom Tromey <tom@tromey.com>
Sun, 8 Oct 2017 23:12:19 +0000 (17:12 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 9 Oct 2017 15:23:22 +0000 (09:23 -0600)
Commit f38307f5 changed COMPILE.post and POSTCOMPILE to remove
$(basename) from the dependency file name computation.  However, it
did not update the `-include' at the end of the Makefile.in; this in
effect disabled automatic dependency tracking.

This patch restores the $(basename) wrapper so that the dependency
files are named "file.Po" rather than "file.o.Po".

I also tested the non-gcc3 dependency mode, which pointed out that
this case hadn't been working since the switch to C++.  This is also
fixed in this patch.

Tested by rebuilding.

ChangeLog
2017-10-09  Tom Tromey  <tom@tromey.com>

* Makefile.in (COMPILE.post, POSTCOMPILE): Restore $(basename).
(COMPILE.pre): Use $(CXX).

gdb/ChangeLog
gdb/Makefile.in

index 9bf5f6e149f55a7512169d425cd7bd00dfb721bb..0688f95e64ebcdc90b57ba67c41c657ccb65a46d 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-09  Tom Tromey  <tom@tromey.com>
+
+       * Makefile.in (COMPILE.post, POSTCOMPILE): Restore $(basename).
+       (COMPILE.pre): Use $(CXX).
+
 2017-10-09  Pedro Alves  <palves@redhat.com>
 
        * cp-support.c (cp_remove_params): Return a gdb::unique_xmalloc_ptr.
index da4095d4a25e1147a3f5c9a191935fdfd2d3399d..18e7750abaf4cb6aa585a59926d596d9b814f2db 100644 (file)
@@ -2952,12 +2952,13 @@ ifeq ($(DEPMODE),depmode=gcc3)
 # into place if the compile succeeds.  We need this because gcc does
 # not atomically write the dependency output file.
 override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-       -MF $(@D)/$(DEPDIR)/$(@F).Tpo
-override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(@F).Tpo \
-       $(@D)/$(DEPDIR)/$(@F).Po
+       -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
+override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
+       $(@D)/$(DEPDIR)/$(basename $(@F)).Po
 else
 override COMPILE.pre = source='$<' object='$@' libtool=no \
-       DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
+       DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
+       $(CXX) -x c++ $(CXX_DIALECT)
 # depcomp handles atomicity for us, so we don't need a postcompile
 # step.
 override POSTCOMPILE =
This page took 0.032742 seconds and 4 git commands to generate.