[GRASS5] Commit sql parser patch, please

Glynn Clements glynn at gclements.plus.com
Tue Jul 5 11:56:47 EDT 2005


Paul Kelly wrote:

> > > Could anyone with CVS write acces commit Glynn's latest patch for the sql
> > > parser? Paul? Glynn? I attach it here so you don't have to seek through past
> > > emails. 
> > 
> > 
> > Done.
> 
> The change to the Makefile (see below) seems to stop y.tab.h being 
> generated (on Cygwin anyway, and compilation then fails in that 
> directory). No idea why.

> -
> -y.tab.c: yac.y
> +
> +y.tab.c y.tab.h: yac.y
>   	$(YACC) -d -v yac.y
> 
> -lex.yy.c: lex.l y.tab.c
> +lex.yy.c: lex.l
>   	$(LEX) lex.l

According to the Makefile, nothing depends upon y.tab.h, so it won't
get rebuilt if it is missing. It will get rebuilt along with y.tab.c,
but that won't occur until y.tab.o is required, while y.tab.h is
required by lex.yy.o. Because the dependencies are generated
automatically using $(wildcard ...), which returns results in
alphabetical order, lex.yy.o will come before y.tab.o.

The old rule for lex.yy.c would force y.tab.c to be regenerated from
yac.y whenever lex.yy.c was required (even though lex.yy.c doesn't
actually *depend* upon y.tab.c). A side effect of regenerating y.tab.c
is to regenerate y.tab.h. As lex.yy.o requires both lex.yy.c and
y.tab.h, this would do the right thing, although more by luck than
judgement.

The missing rule is probably:

	$(OBJDIR)/lex.yy.o: lex.yy.c y.tab.h

(with no action; the default $(OBJDIR)/%.o rule in Rules.make should
provide the correct action).

I'll commit that once I've had a chance to test it.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list