public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gprof doesn't build from cvs
@ 2013-09-05  1:02 Mike Stump
  2013-09-05  2:13 ` Alan Modra
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Stump @ 2013-09-05  1:02 UTC (permalink / raw)
  To: binutils

gprof doesn't build from cvs.  This is a an out of tree build.  GNU make 3.82 has then entire path in $*, so one cannot just add $(srcdir) to it.

$ make
awk -f ../../binutils/binutils/gprof/gen-c-prog.awk > ./../../binutils/binutils/gprof/flat_bl.c \
    FUNCTION=`(echo ../../binutils/binutils/gprof/flat_bl|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
    FILE=../../binutils/binutils/gprof/flat_bl.m ../../binutils/binutils/gprof/../../binutils/binutils/gprof/flat_bl.m
awk: ../../binutils/binutils/gprof/gen-c-prog.awk:29: fatal: cannot open file `../../binutils/binutils/gprof/../../binutils/binutils/gprof/flat_bl.m' for reading (No such file or directory)
make: *** [../../binutils/binutils/gprof/flat_bl.c] Error 2

When I add the patch below, it then works.  I don't know what motived the original, so, I don't know what this solution breaks, if anything.  A make expert should review this.

If one adds these generated files to a tar ball, then, trivially, the problem doesn't appear.  I've switched from tar ball to cvs checkout; so I hit it.

Ok?


diff --git a/binutils/gprof/Makefile.am b/binutils/gprof/Makefile.am
index 97d8c17..cf19cb1 100644
--- a/binutils/gprof/Makefile.am
+++ b/binutils/gprof/Makefile.am
@@ -68,7 +68,7 @@ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
 .m.c:
        awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
            FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
-           FILE=$*.m $(srcdir)/$*.m
+           FILE=$*.m $*.m
 
 POTFILES = $(sources) $(noinst_HEADERS)
 po/POTFILES.in: @MAINT@ Makefile

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gprof doesn't build from cvs
  2013-09-05  1:02 gprof doesn't build from cvs Mike Stump
@ 2013-09-05  2:13 ` Alan Modra
  2013-09-05  3:08   ` Mike Stump
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Modra @ 2013-09-05  2:13 UTC (permalink / raw)
  To: Mike Stump; +Cc: binutils

On Wed, Sep 04, 2013 at 06:02:04PM -0700, Mike Stump wrote:
> diff --git a/binutils/gprof/Makefile.am b/binutils/gprof/Makefile.am
> index 97d8c17..cf19cb1 100644
> --- a/binutils/gprof/Makefile.am
> +++ b/binutils/gprof/Makefile.am
> @@ -68,7 +68,7 @@ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
>  .m.c:
>         awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
>             FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
> -           FILE=$*.m $(srcdir)/$*.m
> +           FILE=$*.m $*.m
>  
>  POTFILES = $(sources) $(noinst_HEADERS)
>  po/POTFILES.in: @MAINT@ Makefile

Not OK.  Breaks building with an absolute source dir and make 3.81.

make[2]: Entering directory `/home/alan/build/gas/all/gprof'
awk -f /src/binutils-current/gprof/gen-c-prog.awk > ./flat_bl.c \
	    FUNCTION=`(echo flat_bl|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
	    FILE=flat_bl.m flat_bl.m
awk: /src/binutils-current/gprof/gen-c-prog.awk:29: fatal: cannot open file `flat_bl.m' for reading (No such file or directory)


-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gprof doesn't build from cvs
  2013-09-05  2:13 ` Alan Modra
@ 2013-09-05  3:08   ` Mike Stump
  2013-09-05  9:01     ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Stump @ 2013-09-05  3:08 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils


On Sep 4, 2013, at 7:12 PM, Alan Modra <amodra@gmail.com> wrote:

> On Wed, Sep 04, 2013 at 06:02:04PM -0700, Mike Stump wrote:
>> diff --git a/binutils/gprof/Makefile.am b/binutils/gprof/Makefile.am
>> index 97d8c17..cf19cb1 100644
>> --- a/binutils/gprof/Makefile.am
>> +++ b/binutils/gprof/Makefile.am
>> @@ -68,7 +68,7 @@ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
>> .m.c:
>>        awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
>>            FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
>> -           FILE=$*.m $(srcdir)/$*.m
>> +           FILE=$*.m $*.m
>> 
>> POTFILES = $(sources) $(noinst_HEADERS)
>> po/POTFILES.in: @MAINT@ Makefile
> 
> Not OK.  Breaks building with an absolute source dir and make 3.81.
> 
> make[2]: Entering directory `/home/alan/build/gas/all/gprof'
> awk -f /src/binutils-current/gprof/gen-c-prog.awk > ./flat_bl.c \
> 	    FUNCTION=`(echo flat_bl|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
> 	    FILE=flat_bl.m flat_bl.m
> awk: /src/binutils-current/gprof/gen-c-prog.awk:29: fatal: cannot open file `flat_bl.m' for reading (No such file or directory)

Ah, that's what I was missing…  That's easy to fix:

diff --git a/binutils/gprof/Makefile.am b/binutils/gprof/Makefile.am
index 97d8c17..b272771 100644
--- a/binutils/gprof/Makefile.am
+++ b/binutils/gprof/Makefile.am
@@ -68,7 +68,7 @@ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
 .m.c:
        awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
            FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
-           FILE=$*.m $(srcdir)/$*.m
+           FILE=$(notdir $*.m) $(srcdir)/$(notdir $*.m)
 
 POTFILES = $(sources) $(noinst_HEADERS)
 po/POTFILES.in: @MAINT@ Makefile


This trims out unconditionally the directory part, and then re-adds the directory to the part that matters.

Ok?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gprof doesn't build from cvs
  2013-09-05  3:08   ` Mike Stump
@ 2013-09-05  9:01     ` Andreas Schwab
  2013-11-02  6:43       ` Alan Modra
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2013-09-05  9:01 UTC (permalink / raw)
  To: Mike Stump; +Cc: Alan Modra, binutils

Mike Stump <mikestump@comcast.net> writes:

> diff --git a/binutils/gprof/Makefile.am b/binutils/gprof/Makefile.am
> index 97d8c17..b272771 100644
> --- a/binutils/gprof/Makefile.am
> +++ b/binutils/gprof/Makefile.am
> @@ -68,7 +68,7 @@ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
>  .m.c:
>         awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
>             FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
> -           FILE=$*.m $(srcdir)/$*.m
> +           FILE=$(notdir $*.m) $(srcdir)/$(notdir $*.m)

I think you want $< instead of $(srcdir)/$*.m, and there should be no
need for $(notdir) at all.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gprof doesn't build from cvs
  2013-09-05  9:01     ` Andreas Schwab
@ 2013-11-02  6:43       ` Alan Modra
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Modra @ 2013-11-02  6:43 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Mike Stump, binutils

On Thu, Sep 05, 2013 at 11:01:11AM +0200, Andreas Schwab wrote:
> I think you want $< instead of $(srcdir)/$*.m, and there should be no
> need for $(notdir) at all.

Yes, that's better.  I'll tidy the output file too.

	* Makefile.am (.m.c): Fix input and output file specification.
	* Makefile.in: Regenerate.

diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 97d8c17..cdd69be 100644
--- a/gprof/Makefile.am
+++ b/gprof/Makefile.am
@@ -66,9 +66,9 @@ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
 %.o:%.m
 
 .m.c:
-	awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
+	awk -f $(srcdir)/gen-c-prog.awk > $@ \
 	    FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
-	    FILE=$*.m $(srcdir)/$*.m
+	    FILE=$*.m $<
 
 POTFILES = $(sources) $(noinst_HEADERS)
 po/POTFILES.in: @MAINT@ Makefile

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-02  6:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05  1:02 gprof doesn't build from cvs Mike Stump
2013-09-05  2:13 ` Alan Modra
2013-09-05  3:08   ` Mike Stump
2013-09-05  9:01     ` Andreas Schwab
2013-11-02  6:43       ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).