automake
[Top][All Lists]
Advanced

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

Re: declaring various files ...


From: Ralf Wildenhues
Subject: Re: declaring various files ...
Date: Mon, 20 Aug 2007 22:45:58 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Roberto,

Another older message:

* Roberto Alejandro Espí Muñoz wrote on Fri, Jul 06, 2007 at 08:04:37PM CEST:
> I finally created my project and managed to create my Makefile.am like so:
>
> hmi_SOURCES =         \
>    $(elementos)
> hmi_LDADD = ./Utils/*.o ./RIPC/*.o ./Middleware/*.o ./IO/*.o ./Graphics/*.o
> ./GTK/*.o ./Events/*.o ./Draw/*.o ./Commands/*.o ./Cairo/*.o ./Base/*.o
> -lsvg -lripcclient -lboost_date_time -lboost_program_options
> -lboost_serialization -lsvg-cairo -lboost_thread -lboost_signals

You should not use wildcards in Makefile.am files, and you should not
reference object files by their name at all.  After all, they might be
called Foo.obj on w32, or renamed due to per-target flags or for other
reasons.

Just list all sources in the respective *_SOURCES variable(s), and they
will be added correctly.  You can factor like:

  elements = foo.c bar.c sub/baz.c
  hmi_SOURCES = $(elements) also_in_hmi.c
  other_program_SOURCES = $(elements) other_prog.c

and you can also use convenience libraries (noinst_LIBRARIES) for
factoring.

Hope that helps.

> Here I can use the "*.o" form to specify all the files in those
> directories.  But when I try to use them in each one of those dirs for
> example:
>
> elementos = AlarmManager.cpp  AlarmsSummary.cpp  Container.cpp
> HMIManager.cpp  Named.cpp  Object.cpp  Screen.cpp  Titled.cpp  Viewer.cpp
> Window.cpp
>
> noinst_LIBRARIES = libBase.a
> libBase_a_SOURCES = $(elementos)
>
> I cannot use it to declare for example:
>
> elementos = *.cpp
>
> noinst_LIBRARIES = libBase.a
> libBase_a_SOURCES = $(elementos)
>
> Is there any way to declare it and specify a directive like the last one??

No, see
<http://www.gnu.org/software/automake/manual/html_node/wildcards.html>.

Cheers,
Ralf




reply via email to

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