This is the mail archive of the automake-prs@sources.redhat.com mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: automake/382: including lex and yacc generated header files


The following reply was made to PR automake/382; it has been noted by GNATS.

From: Alexandre Duret-Lutz <duret_g@lrde.epita.fr>
To: William S Fulton <wsf@fultondesigns.co.uk>
Cc: automake-gnats@sources.redhat.com
Subject: Re: automake/382: including lex and yacc generated header files
Date: Mon, 13 Jan 2003 21:39:00 +0100

 >>> "William" == William S Fulton <wsf@fultondesigns.co.uk> writes:
 
 [...]
 
  William> cat > Makefile.am << 'END'
  William> AUTOMAKE_OPTIONS = subdir-objects
  William> bin_PROGRAMS = foo/foo
  William> foo_foo_CFLAGS = -I$(top_builddir)/foo
  William> foo_foo_SOURCES = foo/bar.c foo/parse.y # This does not work
  William> #foo_foo_SOURCES = foo/parse.y foo/bar.c # This works
  William> AM_YFLAGS = -d
  William> END
 
 In fact listing the .y first might not work either with parallel
 makes.
 
 This is a dependency issue, like the one discussed in the "Built
 source example" section.  I don't think there is anything
 Automake can do about this, however I agree the documentation
 should explain this.
 
 I've written the following text for the documentation (the first
 paragraph already exists).  Let me know if this answers your
 question, or if it would be better worded otherwise.
 
 |    When `yacc' is invoked, it is passed `YFLAGS' and `AM_YFLAGS'.  The
 | former is a user variable and the latter is intended for the
 | `Makefile.am' author.
 | 
 |    `AM_YFLAGS' is usually used to pass the `-d' option to `yacc'.
 | Automake knows what this means and will automatically adjust its rules
 | to update and distribute the header file built by `yacc -d'.  What
 | Automake cannot guess, though, is where this header will be used: it is
 | up to you to ensure the header gets built before it is first used.
 | This is commonly sorted out by listing the header file in
 | `BUILT_SOURCES' (*note Sources::) as follows.
 | 
 |      BUILT_SOURCES = parser.h
 |      AM_YFLAGS = -d
 |      bin_PROGRAMS = foo
 |      foo_SOURCES = ... parser.y ...
 -- 
 Alexandre Duret-Lutz
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]