automake
[Top][All Lists]
Advanced

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

Re: Overriding suffix based implicit rules


From: Stepan Kasal
Subject: Re: Overriding suffix based implicit rules
Date: Tue, 27 Mar 2007 21:30:10 +0200
User-agent: Mutt/1.4.2.1i

Hello,

On Tue, Mar 27, 2007 at 05:40:06AM -0700, Artus wrote:
> What should I write in Makefile.am to inform automake that .c files in this
> specific directory are C++ source files and not C files? I tried the
> following with no sucess (and I do not want to rename the files).

"no success" is far from a good description of your problem.
Anyway:

> # Makefile.am
> .c.o:
>       $(CXX) $(CXXFLAGS) -c $< -o $@
> lib_LTLIBRARIES = libadn.la
> libadn_la_SOURCES = adn.h adn.c tim.c cyto.c

since you are using lib_LTLIBRARIES, it's .c.lo which is involved here,
not .c.o

Another solution:
Even though you cannot use the right names permanently, you can
use them temporarily.  Try this Makefile.am:

lib_LTLIBRARIES = libadn.la
libadn_la_SOURCES = adn.h adn.c tim.c cyto.c
.c.lo:
.c.cc:
        $(LN_S) $< $@
EXTRA_PROGRAMS = fake
nodist_fake_SOURCES = fake.cc

I tested this, and it works.  The fake program is there to drag in
C++ support.

Please note that though the *.cc files are temporarily created,
make delets them at the end, because they are intermediate.
(Use   info '(make)Chained Rules'   to read details.)

Could you live with this?

Have a nice day,
        Stepan Kasal




reply via email to

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