problem with bison
Satish Balay
balay at mcs.anl.gov
Thu Jul 17 14:00:42 CDT 2008
What I mean by not having the correct make targets is:
PETSc provides a make target for compiling .c files into .o files. i.e
.c.o:
${CC} -c -I${PETSC_DIR} -I ${PETSC_DIR}/include $<
However when your sourcefile is .y - and not .c, make is using a .y.o
target such as:
.y.o:
${YACC} $<
${CC} -c ${CFLAGS} -o $*.o y.tab.c
This '.y.o:' target might be internal to make. So I was speculating
that becuase this other target is used to create .y.o - instead of the
'.c.o' from PETSc - the compile is failing.
I was sugesting - perhaps you can add a '.y.c' target in your makefile
- this way make uses .y -> .c and .c -> .o targets [instead of .y->.o
target]
.y.c:
${YACC} $<
[or whatever the correct syntax for invoking yacc to convert foo.y to foo.c is]
Satish
On Thu, 17 Jul 2008, Nicolas Flipo wrote:
> Hi Satish,
>
> I'm not sure to understand exactly what you mean.
> The last thing is that I don't understand why include
> ${PETSC_DIR}/bmake/common/base doesn't work for bison?
> Nico
> On Thu, Jul 17, 2008 at 9:40 AM, Satish Balay <balay at mcs.anl.gov> wrote:
> > Hmm - perhaps you need to specify a '.y.c:' target in your makefile?
> >
> > It loks like make is using a '.y.o:' target - thus skipping '.c.o:'
> > target as defined in PETSc makefiles.
> >
> >> gcc -g -Wall -DYYDEBUG -c -o newent.o y.tab.c
> >
> > If PETSc target for .c file is used - you should see
> > -I$PETSC_DIR/include etc options aswell.
> >
> > Satish
More information about the petsc-users
mailing list