Re: generated lex/yacc sources?

2021-09-21 Thread Jan Engelhardt


On Tuesday 2021-09-21 22:32, Karl Berry wrote:
>Thanks much. I was thinking I should avoid that since the .[ly] are not
>ultimate sources, but if it works, fine with me.
>
>jan>
>BUILT_SOURCES = foo.y
>foo.y: foo.cweb
>somecommands
>
>That would be sensible, but I failed to mention the problem with
>BUILT_SOURCES (sorry): the manual says it only works with the general
>targets (all, check, install, install-exec). I need something that works
>with individual targets.

The example that the manual gives (the one with foo.c and foo.h) has a
peculiarity: it involves $CC's automatic dependency _generation_,
which, in that case, implies a cycle:

  * foo.o (for practical purposes) requires foo.c and foo.h

  * but the _dependency_ (edge in make's DAG) "foo.o: foo.h"
is only available after foo.o's command (gcc -Wp,-M*) has run.

BUILT_SOURCES is just a bandaid for that missing dependency, and yes,
this cycle breaker is only hooked to all/check/install.

If you were to hardcode into Makefile.am:

foo.${OBJEXT}: foo.h

then BUILT_SOURCES would not be needed at all.

==

In your lex/yacc case, there is no such cycle anyway, because foo.h
already exists (created by lex or yacc - I always forget which)
by the time foo.o compilation is attempted.



Re: generated lex/yacc sources?

2021-09-21 Thread Karl Berry
Hi Nick, Jan, all,

nick> I think all that should be needed is to list the .l (or .y) file in
_SOURCES normally

Thanks much. I was thinking I should avoid that since the .[ly] are not
ultimate sources, but if it works, fine with me.

jan>
BUILT_SOURCES = foo.y
foo.y: foo.cweb
somecommands

That would be sensible, but I failed to mention the problem with
BUILT_SOURCES (sorry): the manual says it only works with the general
targets (all, check, install, install-exec). I need something that works
with individual targets.

I'll give the _SOURCES stuff a whirl. Thanks again. -k




Re: [platform-testers] automake-1.16g snapshot

2021-09-21 Thread Karl Berry
Redoing the tests with 1.16g I now have 9 failed tests, the
testsuite.log is attached.

Thanks much for giving it a whirl right away.
But are those failures anything new? 

FAIL: t/fn99subdir
FAIL: t/lex-clean-cxx
FAIL: t/lex-depend-cxx
FAIL: t/test-extensions-empty
FAIL: t/subpkg
FAIL: t/subpkg2
FAIL: t/subpkg3
FAIL: t/subpkg-yacc
FAIL: t/vala-mix2

They don't look like anything that was touched in these small changes
since 1.16.4; the only real purpose for the release is to get back to
the historical Python directory behavior.

At least the lex/yacc stuff hasn't worked with Solaris tools for quite a
while. There are a number of open bugs relating to Solaris at
  https://debbugs.gnu.org/cgi/pkgreport.cgi?package=automake#_0_4_3 
but no one has come forward to look into them. (They will never make it
to the top of my list to work on, sorry to say.)

Thanks again,
Karl



Re: generated lex/yacc sources?

2021-09-21 Thread Nick Bowler
On 21/09/2021, Karl Berry  wrote:
> Suppose I want to generate a lex or yacc input file from another file,
> e.g., a CWEB literate program. Is there a way to tell Automake about
> this so that the ultimately-generated parser/lexer [.ch] files are saved
> in srcdir, as happens when [.ly] are direct sources, listed in *_SOURCES?
>
> I should know the answer to this, but sadly, I don't. I couldn't find
> any hints in the manual or sources or online, although that probably
> only indicates insufficient searching.

I think all that should be needed is to list the .l (or .y) file in
_SOURCES normally, then just write a suitable make rule to update
it from the literate sources.  Automake doesn't "know" about it but
make should do the right thing.  For example, this seems to work OK:

  % cat >Makefile.am <<'EOF'
bin_PROGRAMS = main

main_SOURCES = main.l

# for simplicity, keep distributed stuff in srcdir
$(srcdir)/main.l: $(srcdir)/main.x
cp $(srcdir)/main.x $@

EXTRA_DIST = main.x
MAINTAINERCLEANFILES = main.l
EOF

Cheers,
  Nick



Re: generated lex/yacc sources?

2021-09-21 Thread Jan Engelhardt
On Tuesday 2021-09-21 19:02, Karl Berry wrote:

>Suppose I want to generate a lex or yacc input file from another file,
>e.g., a CWEB literate program. Is there a way to tell Automake about
>this so that the ultimately-generated parser/lexer [.ch] files are saved
>in srcdir, as happens when [.ly] are direct sources, listed in *_SOURCES?
>
>I should know the answer to this, but sadly, I don't. I couldn't find
>any hints in the manual or sources or online, although that probably
>only indicates insufficient searching.

Will

BUILT_SOURCES = foo.y
foo.y: foo.cweb
somecommands

do the trick for you?



generated lex/yacc sources?

2021-09-21 Thread Karl Berry
Suppose I want to generate a lex or yacc input file from another file,
e.g., a CWEB literate program. Is there a way to tell Automake about
this so that the ultimately-generated parser/lexer [.ch] files are saved
in srcdir, as happens when [.ly] are direct sources, listed in *_SOURCES?

I should know the answer to this, but sadly, I don't. I couldn't find
any hints in the manual or sources or online, although that probably
only indicates insufficient searching.

Thanks for any clues. --karl