[GRASS5] G57 compile errors in r.mapcalc

Markus Neteler neteler at itc.it
Mon May 24 12:19:39 EDT 2004


On Mon, May 24, 2004 at 05:04:14PM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > > It appears that y.tab.c was to be placed into the OBJ dir, but the OBJ 
> > > dir was not yet created. Also, it doesn't seem like y.tab.c should be 
> > > place into the OBJ dir at all.

[...]

> OK; the original rule was:
> 
> y.tab.c y.tab.h: mapcalc.y
> 	$(YACC) -d mapcalc.y
> 	\mkdir -p $(OBJDIR)
> 	$(CC) $(LDFLAGS) $(INC) $(XTRA_LDFLAGS) -o $(OBJDIR)/$*.o -c $*.c
> 
> This was changed to put y.tab.[ch] into $(OBJDIR):
> 
> y.tab.c y.tab.h: mapcalc.y
> 	$(YACC) -b $(OBJDIR)/y -d mapcalc.y
> 	$(MKDIR) $(OBJDIR)
> 	$(CC) $(LDFLAGS) $(INC) $(XTRA_LDFLAGS) -o $(OBJDIR)/$*.o -c $*.c
> 
> This won't work because:
> 
> a) the rule's targets are y.tab.c and y.tab.h, but it's actually
> creating $(OBJDIR)/y.tab.c and $(OBJDIR)/y.tab.h.
> 
> b) The compilation command is still compiling y.tab.c, not
> $(OBJDIR)/y.tab.c, and there don't appear to be any compiler switches
> to force the compiler to look in $(OBJDIR) for y.tab.h.
> 
> c) $(OBJDIR) isn't created until after $(YACC) has been told to put
> its output files there.
> 
> In Funkmeister's case, the new Makefile was creating the new
> y.tab.[ch] files (based upon the new mapcalc.y, which was changed to
> support r3.mapcalc) in a different directory, then using the old
> y.tab.[ch] (left over from a previous build) instead.

Ok, now I get the point.

 
> So, as Funkmeister noted, you essentially need to revert the changes:
> 
> y.tab.c y.tab.h: mapcalc.y
>         $(MKDIR) $(OBJDIR)
>         $(YACC) -b y -d mapcalc.y
>         $(CC) $(LDFLAGS) $(INC) $(XTRA_LDFLAGS) -o $(OBJDIR)/$*.o -c $*.c
> 
> This is almost identical to the original version, except that \mkdir
> is replaced with $(MKDIR), and becomes the first command.

Done in CVS, thanks!

Markus




More information about the grass-dev mailing list