From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/4] Makefile: Replace explicit subdir rules with pattern rules
Date: Tue, 15 Nov 2016 18:41:00 -0000 [thread overview]
Message-ID: <fb2e37859c6ccedaa3eed1dcd72f2212@polymtl.ca> (raw)
In-Reply-To: <6f62ae95-b0a4-48cc-cc09-63a57fa18c44@redhat.com>
On 2016-11-15 13:36, Pedro Alves wrote:
> On 11/15/2016 06:00 PM, Simon Marchi wrote:
>> On 2016-11-15 12:54, Pedro Alves wrote:
>>> On 11/13/2016 03:46 AM, Simon Marchi wrote:
>>>> # Need to explicitly specify the compile rule as make will do
>>>> nothing
>>>> # or try to compile the object file into the sub-directory.
>>>
>>> Do these comments need adjustment?
>>
>> I thought they were still true and relevant after the change. What do
>> you think?
>
> But should we at least merge them? Looking at your branch on github,
> we end up with:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> #
> # gdb/cli/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: $(srcdir)/cli/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> # GCC Compile support dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: $(srcdir)/compile/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> #
> # GDBTK sub-directory
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the mi directory.
>
> all-gdbtk: insight$(EXEEXT)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> The last one is strange, for talking about MI.
>
>
> And then a bit further below, we have the same comment several
> times again:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> #
> # gdb/mi/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: $(srcdir)/mi/%.c
> $(COMPILE) $<
>
> # gdb/common/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: ${srcdir}/common/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> common-agent.o: $(srcdir)/common/agent.c
> $(COMPILE) $(srcdir)/common/agent.c
> $(POSTCOMPILE)
>
> #
> # gdb/target/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: ${srcdir}/target/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> #
> # gdb/arch/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: ${srcdir}/arch/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> # gdb/nat/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: ${srcdir}/nat/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> #
> # gdb/tui/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: $(srcdir)/tui/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> # gdb/guile dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> %.o: $(srcdir)/guile/%.c
> $(COMPILE) $<
> $(POSTCOMPILE)
>
> # gdb/python/ dependencies
> #
> # Need to explicitly specify the compile rule as make will do nothing
> # or try to compile the object file into the sub-directory.
>
> # Flags needed to compile Python code
> PYTHON_CFLAGS=@PYTHON_CFLAGS@
>
> %.o: $(srcdir)/python/%.c
> $(COMPILE) $(PYTHON_CFLAGS) $<
> $(POSTCOMPILE)
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> I think a single comment talking about needing a compile rule for
> each subdir, might be clearer/simpler.
>
> Also, the cases that are exceptions I think would benefit
> from a comment, like e.g., the common-agent.o rule.
>
> Thanks,
> Pedro Alves
Agreed, I'll do the change in v2.
Thanks,
Simon
next prev parent reply other threads:[~2016-11-15 18:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-13 3:46 [PATCH 0/4] Makefile improvements and cleanups Simon Marchi
2016-11-13 3:46 ` [PATCH 3/4] Makefile: Flatten and sort file lists Simon Marchi
2016-11-15 16:46 ` Pedro Alves
2016-11-13 3:46 ` [PATCH 2/4] Makefile: Replace explicit subdir rules with pattern rules Simon Marchi
2016-11-15 17:54 ` Pedro Alves
2016-11-15 18:00 ` Simon Marchi
2016-11-15 18:36 ` Pedro Alves
2016-11-15 18:41 ` Simon Marchi [this message]
2016-11-13 3:46 ` [PATCH 1/4] Makefile: Replace old suffix " Simon Marchi
2016-11-13 3:56 ` [PATCH 0/4] Makefile improvements and cleanups Simon Marchi
2016-11-13 8:49 ` Andreas Schwab
2016-11-13 15:26 ` Simon Marchi
2016-11-13 16:25 ` Eli Zaretskii
2016-11-15 16:57 ` Pedro Alves
2016-11-15 17:15 ` Simon Marchi
2016-11-15 17:51 ` Pedro Alves
2016-11-15 21:58 ` Pedro Alves
2016-11-15 22:10 ` Simon Marchi
2016-11-15 21:46 ` John Baldwin
2016-11-17 18:54 ` John Baldwin
2016-11-17 19:20 ` Simon Marchi
2016-11-17 22:36 ` John Baldwin
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=fb2e37859c6ccedaa3eed1dcd72f2212@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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