Makefile and bfin-parse.c ?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Makefile and bfin-parse.c ?

Christian Joensson-2
Just a ping here, I get warnings

Makefile:3138: warning: overriding commands for target `bfin-parse.c'
Makefile:2744: warning: ignoring old commands for target `bfin-parse.c'

Is this wellknown?

--
Cheers,

/ChJ
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

Ian Lance Taylor
Christian Joensson <[hidden email]> writes:

> Just a ping here, I get warnings
>
> Makefile:3138: warning: overriding commands for target `bfin-parse.c'
> Makefile:2744: warning: ignoring old commands for target `bfin-parse.c'
>
> Is this wellknown?

I expect that the bfin-parse.c rule should be copied from the existing
m68k-parse.c rule.  And there should not be one rule creating both the
bfin-parse.c and the bfin-parse.tab.h targets.

The current situation does no harm other than the above warning.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

jiez
Ian Lance Taylor wrote:

> Christian Joensson <[hidden email]> writes:
>>
>>Makefile:3138: warning: overriding commands for target `bfin-parse.c'
>>Makefile:2744: warning: ignoring old commands for target `bfin-parse.c'
>>
>>Is this wellknown?
>
>
> I expect that the bfin-parse.c rule should be copied from the existing
> m68k-parse.c rule.  And there should not be one rule creating both the
> bfin-parse.c and the bfin-parse.tab.h targets.
>
> The current situation does no harm other than the above warning.
>
I'm trying to figure out how to remove these warnings. However, I have
little knowledge about automake. So I need your help. The overriding
rule is written in Makefile.am, the other is automatically generated by
automake. Automake won't generate its rule if I remove bfin-parse.tab.h
from the rule in Makefile.am. However, creating both bfin-parse.c and
bfin-parse.tab.h is a common way to write yacc/bison rule in Makefile.
Why can automake not recognize such rules? And I also found that there
is a rule creating both itbl-parse.c and itbl-parse.h but automake
doesn't generate a rule for itbl-parse.c. How is this accomplished in
Makefile.am?

Thanks,
Jie
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

Ian Lance Taylor
Jie Zhang <[hidden email]> writes:

> I'm trying to figure out how to remove these warnings. However, I have
> little knowledge about automake. So I need your help. The overriding
> rule is written in Makefile.am, the other is automatically generated
> by automake. Automake won't generate its rule if I remove
> bfin-parse.tab.h from the rule in Makefile.am. However, creating both
> bfin-parse.c and bfin-parse.tab.h is a common way to write yacc/bison
> rule in Makefile. Why can automake not recognize such rules? And I
> also found that there is a rule creating both itbl-parse.c and
> itbl-parse.h but automake doesn't generate a rule for
> itbl-parse.c. How is this accomplished in Makefile.am?

I am hardly an automake expert.  I don't know how automake decides
when to generate a rule.  I don't know why itbl-parse.[ch] doesn't
have the same problem.  The obvious difference is that I see
itbl-parse.c and itbl-parse.h, but I see bfin-parse.c and
bfin-parse.tab.h.  Perhaps if you change bfin-parse.tab.h to
bfin-parse.h automake will recognize what is going on.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

jiez
On 24 Oct 2005 10:33:57 -0700, Ian Lance Taylor <[hidden email]> wrote:
> Jie Zhang <[hidden email]> writes:
>
> The obvious difference is that I see
> itbl-parse.c and itbl-parse.h, but I see bfin-parse.c and
> bfin-parse.tab.h.  Perhaps if you change bfin-parse.tab.h to
> bfin-parse.h automake will recognize what is going on.
>
I tried it. The warnings were still there.

Jie
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

Ian Lance Taylor
Jie Zhang <[hidden email]> writes:

> On 24 Oct 2005 10:33:57 -0700, Ian Lance Taylor <[hidden email]> wrote:
> > Jie Zhang <[hidden email]> writes:
> >
> > The obvious difference is that I see
> > itbl-parse.c and itbl-parse.h, but I see bfin-parse.c and
> > bfin-parse.tab.h.  Perhaps if you change bfin-parse.tab.h to
> > bfin-parse.h automake will recognize what is going on.
> >
> I tried it. The warnings were still there.

I suppose the other thing to try would be to separate the targets:

bfin-parse.c: ...
        ...
bfin-parse.h: bfin-parse.c

Or ask on the automake mailing list.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

H.J. Lu-27
In reply to this post by jiez
On Tue, Oct 25, 2005 at 02:06:35AM +0800, Jie Zhang wrote:

> On 24 Oct 2005 10:33:57 -0700, Ian Lance Taylor <[hidden email]> wrote:
> > Jie Zhang <[hidden email]> writes:
> >
> > The obvious difference is that I see
> > itbl-parse.c and itbl-parse.h, but I see bfin-parse.c and
> > bfin-parse.tab.h.  Perhaps if you change bfin-parse.tab.h to
> > bfin-parse.h automake will recognize what is going on.
> >
> I tried it. The warnings were still there.
>

Is bfin-parse.tab.h really needed? This patch seems to work.


H.J.
--- gas/Makefile.am.dup 2005-10-24 17:32:45.000000000 -0700
+++ gas/Makefile.am 2005-10-24 17:47:33.000000000 -0700
@@ -605,7 +605,7 @@ m68k-parse.o: m68k-parse.c $(srcdir)/con
 m68k-parse.h: ; @true
 $(srcdir)/config/m68k-parse.h: ; @true
 
-bfin-parse.c bfin-parse.tab.h: $(srcdir)/config/bfin-parse.y
+bfin-parse.c: $(srcdir)/config/bfin-parse.y
  $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
 bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h
 
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

jiez
On 10/25/05, H. J. Lu <[hidden email]> wrote:
> > > Jie Zhang <[hidden email]> writes:
> > I tried it. The warnings were still there.
> >
>
> Is bfin-parse.tab.h really needed? This patch seems to work.
>
> -bfin-parse.c bfin-parse.tab.h: $(srcdir)/config/bfin-parse.y

Oh, It's a typo of my last patch to rename bfin-parse.tab.h to
bfin-parse.h. It should be

  bfin-parse.c bfin-parse.h: $(srcdir)/config/bfin-parse.y

I will fix it when I can access the CVS on sourceware.org.

Anyway, writing both targets in yacc rule is a common practice. And
it's OK for itbl-parse.c and itbl-parse.h.

Thanks,
Jie
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

H.J. Lu-27
On Tue, Oct 25, 2005 at 10:17:16AM +0800, Jie Zhang wrote:

> On 10/25/05, H. J. Lu <[hidden email]> wrote:
> > > > Jie Zhang <[hidden email]> writes:
> > > I tried it. The warnings were still there.
> > >
> >
> > Is bfin-parse.tab.h really needed? This patch seems to work.
> >
> > -bfin-parse.c bfin-parse.tab.h: $(srcdir)/config/bfin-parse.y
>
> Oh, It's a typo of my last patch to rename bfin-parse.tab.h to
> bfin-parse.h. It should be
>
>   bfin-parse.c bfin-parse.h: $(srcdir)/config/bfin-parse.y
>

In that case, this should work.


H.J.
--- gas/Makefile.am.dup 2005-10-24 17:32:45.000000000 -0700
+++ gas/Makefile.am 2005-10-24 19:57:23.000000000 -0700
@@ -605,8 +605,9 @@ m68k-parse.o: m68k-parse.c $(srcdir)/con
 m68k-parse.h: ; @true
 $(srcdir)/config/m68k-parse.h: ; @true
 
-bfin-parse.c bfin-parse.tab.h: $(srcdir)/config/bfin-parse.y
+bfin-parse.c: $(srcdir)/config/bfin-parse.y
  $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
+bfin-parse.h: bfin-parse.c
 bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h
 
 bfin-defs.h: ; @true
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

H.J. Lu-27
In reply to this post by jiez
On Tue, Oct 25, 2005 at 10:17:16AM +0800, Jie Zhang wrote:

> On 10/25/05, H. J. Lu <[hidden email]> wrote:
> > > > Jie Zhang <[hidden email]> writes:
> > > I tried it. The warnings were still there.
> > >
> >
> > Is bfin-parse.tab.h really needed? This patch seems to work.
> >
> > -bfin-parse.c bfin-parse.tab.h: $(srcdir)/config/bfin-parse.y
>
> Oh, It's a typo of my last patch to rename bfin-parse.tab.h to
> bfin-parse.h. It should be
>
>   bfin-parse.c bfin-parse.h: $(srcdir)/config/bfin-parse.y

This isn't parallel build safe. I checked in my fix.


H.J.
Reply | Threaded
Open this post in threaded view
|

Re: Makefile and bfin-parse.c ?

jiez
On 10/25/05, H. J. Lu <[hidden email]> wrote:
> >
> >   bfin-parse.c bfin-parse.h: $(srcdir)/config/bfin-parse.y
>
> This isn't parallel build safe. I checked in my fix.

Hongjiu, Thanks!

Jie