tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: make: dealing with targets with multiple outputs
On Tue, Jun 11, 2019 at 02:00:39PM -0000, Christos Zoulas wrote:
> In article <27887.1560240087%splode.eterna.com.au@localhost>,
> matthew green <mrg%eterna.com.au@localhost> wrote:
> >"Simon J. Gerraty" writes:
> >> David Holland <dholland-tech%netbsd.org@localhost> wrote:
> >> > No, the special target should be for the unusual case.
> >> >
> >> > The usual case is:
> >> >
> >> > y.tab.c y.tab.h: foo.y
> >> > $(YACC) -d foo.y
> >>
> >> Sorry I've been away...
> >>
> >> AFAIK yacc is normally handled via suffix rules.
> >> How is that case handled?
> >
> >AFAICT, yacc handling is currently poor and is (part of)
> >what dholland is trying to propose a fix for.
>
> I think we should be trying to fix this by first implementing pattern rules
> instead of introducing new syntax.
So it seems that in gmake, while if you write
foo.h foo.c: foo.y
yacc -d foo.y
it does the wrong thing, if you write a pattern rule of the same form:
%.h %.c: %.y
yacc -d foo.y
it does the right thing. Although this which should be equivalent:
foo.h foo.c: %.h %.c: %.y
yacc -d foo.y
causes a syntax error.
I don't particularly approve of this. I think the behavior of the
pattern rule and the non-pattern rule with the same syntax should be
the same. Declaring pattern rules of this form is well and good (and I
wonder when gmake added it; I'm pretty sure it didn't work back in the
day) but it isn't a substitute for handling the basic form correctly.
(I also still don't like gmake-style pattern rules at all, but I
suppose the world has me substantially outvoted.)
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index