This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/4] Makefile: Replace old suffix rules with pattern rules
> Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org
> From: Pedro Alves <palves@redhat.com>
> Date: Wed, 16 Nov 2016 17:32:28 +0000
>
> >> # The only suffixes we want for implicit rules are .c and .o, so clear
> >> # the list and add them. This speeds up GNU Make, and allows -r to work.
> >> # For i18n support, we also need .gmo, .po, .pox.
> >> # This must come before the language makefile fragments to allow them to
> >> # add suffixes and rules of their own.
> >> .SUFFIXES:
> >> .SUFFIXES: .c .cc .o .po .pox .gmo
> >> ~~~
> >>
> >> I don't know why they still add some suffixes instead of relying
> >> on the pattern rules. Might just be legacy.
> >
> > No, it's because of the built-in rules. They are by default
> > considered no matter which pattern rules you have in the Makefile,
> > because theoretically each .c file can be built from some other file
> > in any number of ways.
>
> I still don't understand. The question is why they add back
> some suffixes _after_ having deleted all the implicit rules.
> I.e., why do:
>
> .SUFFIXES:
> .SUFFIXES: .c
>
> instead of:
>
> .SUFFIXES:
> %.o: %.c
>
> They use pattern rules for other, more specific cases, AFAICS.
Doesn't the comment explain that?
And who said you should use pattern rules for everything? Suffix
rules are not a dirty word.