From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Jongman Heo" <jongman.heo@samsung.com>,
"Thomas Rast" <trast@student.ethz.ch>, git <git@vger.kernel.org>,
"Antoine Pelisse" <apelisse@gmail.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH resend] Makefile: explicitly set target name for autogenerated dependencies
Date: Fri, 1 Feb 2013 19:03:13 -0500 [thread overview]
Message-ID: <20130202000313.GA30191@sigill.intra.peff.net> (raw)
In-Reply-To: <20130201224519.GI12368@google.com>
On Fri, Feb 01, 2013 at 02:45:19PM -0800, Jonathan Nieder wrote:
> After a change in a header file, object files in a subdirectory are
> not automatically rebuilt by "make":
>
> $ touch cache.h
> $ make builtin/add.o
> $
>
> Luckily we can prevent trouble by explicitly supplying the name of the
> target to ccache and gcc, using the -MQ option. Do so.
Thanks, I missed the original thread last year, but this does look like
the same problem. The fixed version of ccache is a few years old, but
the OP did mention RHEL5, so that makes sense.
> missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
> dep_file = $(dir $@).depend/$(notdir $@).d
> -dep_args = -MF $(dep_file) -MMD -MP
> +dep_args = -MF $(dep_file) -MQ $@ -MMD -MP
This looks like a nice simple solution. The only downside would be if
-MQ is not supported by some gcc versions (in which case we would do
better to improve the "can we use computed dependencies" check, and
punish people on old ccache, not people on old gcc who otherwise could
work without -MQ).
As far as I can tell, though, -MQ came along with the other dependency
generation options in 2001:
http://gcc.gnu.org/news/dependencies.html
which means it's not a problem to rely on. So the patch looks good to
me.
-Peff
prev parent reply other threads:[~2013-02-02 0:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 10:59 Re: Re: Re: Segmentation fault with latest git (070c57df) Jongman Heo
2013-02-01 22:38 ` Jonathan Nieder
2013-02-01 22:45 ` [PATCH resend] Makefile: explicitly set target name for autogenerated dependencies Jonathan Nieder
2013-02-02 0:03 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130202000313.GA30191@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=apelisse@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jongman.heo@samsung.com \
--cc=jrnieder@gmail.com \
--cc=pclouds@gmail.com \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).