This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: replace suffix rules with pattern rules


On Mon, Jan 13, 2014 at 2:45 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Patrick" == Patrick Palka <patrick@parcs.ath.cx> writes:
>
> Patrick> Suffix rules (e.g. .c.o:) are error-prone and may not interact
> Patrick> well with GNU make's -r/--no-builtin-rules flag.  Replace them
> Patrick> with otherwise-equivalent pattern rules (e.g. %.o: %.c).
>
> Despite appearances, gdb's use of GNU make features is constrained to
> parallel check and, if GNU make is available, dependency tracking.  That
> is, in theory you can do a "one-off" build of gdb using some other make.

I see.  That explains why e.g. static pattern rules are not used either.

> I wouldn't mind requiring GNU make -- gcc has done it for years without
> adverse effects -- but it isn't currently the case.
>
> TBH I am not sure how you'd go about getting this sort of change
> approved.
>
> Patrick> As a result of this change, one can now successfully build gdb/ with
> Patrick> make's -r flag which improves build time by a bit.
>
> There's a zillion other directories to cope with in the tree.
> Does make -r work in all of them except gdb?
> If so, how?

Not all.  The directories whose makefiles are generated by automake
work under make -r and so do the ones that don't use suffix rules at
all. The ones generated by
automake work because automake makes sure to explicitly populate the
.SUFFIXES target with the relevant file extensions.  The gdb/ makefile
doesn't work
under make -r essentially because it relies on a ".c.o:" suffix rule
but the file extensions .c and .o are not in .SUFFIXES.  (So, a
portable variant of the above patch would be to make sure to add .c
and .o into the .SUFFIXES target, leaving the suffix rules in place.)
Likewise for one or two other makefiles in the tree, suchas the one
under readline/.

I was not aware of the concern about portability.  I'll repost a
portable version of the patch once I submit my copyright assignment.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]