automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regarding multiple parser.y in a singke Makefile.am


From: Stepan Kasal
Subject: Re: regarding multiple parser.y in a singke Makefile.am
Date: Fri, 23 Sep 2005 17:15:02 +0200
User-agent: Mutt/1.4.1i

Hello,

> On Thu, Sep 22, 2005 at 11:38:00AM -0500, Nitesh Soni (NC/TNT) wrote:
> >  eg....  I have parser.y in  src/libX/src and in src/libY/src ...
> >    
> > I have a single Makefile.am at "src" level.

I asked:
> are you using the subdir-objects option?

Nitesh Soni (NC/TNT) wrote in a private mail:
> No.

then I think that the easiest fix would be to use different filenames for
the two parsers, eg. parserX.y and parserY.y .

If you cannot rename them, just make a link under the different name and use
that. Something like:

PROGRAMS = foobar
nodist_foobar_SOURCES = parserX.y parserY.y
CLEANFILES = $(nodist_foobar_SOURCES)
EXTRA_DIST = src/libX/src/parser.y src/libY/src/parser.y

parserX.y: src/libX/src/parser.y
        rm -f $@
        $(LN_S) src/libX/src/parser.y $@

parserY.y: src/libY/src/parser.y
        rm -f $@
        $(LN_S) src/libY/src/parser.y $@

And call AC_PROG_LN_S in your configure.ac.

> Can u tell me what this option is?

To quote from the Automake manual:

`subdir-objects'
     If this option is specified, then objects are placed into the
     subdirectory of the build directory corresponding to the
     subdirectory of the source file.  For instance, if the source file
     is `subdir/file.cxx', then the output file would be
     `subdir/file.o'.

Without this option, you cannot have dir1/foo.c and dir2/foo.c, because
both would be compiled into ./foo.o .  And the same holds for *.y sources.

With that option, things should work.  So this would be another
alternative.  `subdir-objects' is relatively new, though, so you may
encounter an Automake bug...

HTH,
-- Stepan Kasal

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]