bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] [PATCH] dependency for parallel make (bison)


From: Andrew J. Schorr
Subject: Re: [bug-gawk] [PATCH] dependency for parallel make (bison)
Date: Tue, 12 Sep 2017 14:49:59 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Tue, Sep 12, 2017 at 12:34:44PM -0600, address@hidden wrote:
> We already rely on the parser generator being Bison beause of the -p
> option, so using -o is not awful. I am adding a note in the README.

Good.

> > >  With
> > > -o, we could eliminate the bisonfix.awk hack for awkgram.y as well, but 
> > > that
> > > rule is a bit messier because of the shenanigans with y.tab.h.
> 
> Andy, please pull in a litle bit and then if you can come up
> with such a fix, that'd be great.

The current rule says:

awkgram.c: awkgram.y
        $(YACC) $(AM_YFLAGS) $(YFLAGS) $<
        sed 's/parse error/syntax error/g' < y.tab.c | awk -f 
"$(srcdir)"/bisonfix.awk awkgram > $*.c && rm y.tab.c
        if test -f y.tab.h; then \
        if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
        else :; fi

What is the purpose of the y.tab.h manipulations? When I run bison, I do
not see any y.tab.h file being produced, so I don't understand the goal
of that part of the rule. Is it generated on some platforms, and if so, why
do we rename it to awkgram.h? The simple fix is to remove that:

awkgram.c: awkgram.y
        $(YACC) -o $@ $(AM_YFLAGS) $(YFLAGS) $<
        sed 's/parse error/syntax error/g' < $@ > address@hidden && mv 
address@hidden $@

But perhaps there is a good reason for mucking with y.tab.h that I do
not understand...

The full patch is attached. And we can now remove bisonfix.awk from the
repository.

Regards,
Andy

Attachment: bisonfix.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]