automake
[Top][All Lists]
Advanced

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

Re: need help in "deep" project ..


From: Ralf Wildenhues
Subject: Re: need help in "deep" project ..
Date: Tue, 3 Jul 2007 19:36:20 +0200
User-agent: Mutt/1.5.15 (2007-05-20)

* Roberto Alejandro Espí Muñoz wrote on Tue, Jul 03, 2007 at 07:11:43PM CEST:
>
> AC_INIT([/src/main.cpp])

Please remove the leading slash:
 AC_INIT([src/main.cpp])

Also note that there is a new form of AC_INIT/AM_INIT_AUTOMAKE,
used and explained in the manual:
<http://sources.redhat.com/automake/automake.html#Hello-World>

> AM_INIT_AUTOMAKE([hmi], [0.3])
> AUTOMAKE_OPTIONS = foreign
> AC_PROG_CXX
> AC_CONFIG_FILES([
>    Makefile
>    src/Makefile
>    src/Base/Makefile
>    src/Cairo/Makefile
>    src/Commands/Makefile
>    src/Draw/Makefile
>    src/Events/Makefile
>    src/IO/Makefile
>    src/Middleware/Makefile
>    src/RIPC/Makefile
>    src/Utils/Makefile
>     ])
> AC_OUTPUT
>
> My Makefile.am:
> Here I defined my compile and link flags.
>
> SUBDIRS = src

> bin_PROGRAMS = main
> hmi_SOURCES = src/main.cpp

Two points here: if your program is to be called hmi, then above should
be
  bin_PROGRAMS = hmi

if it is to be called 'main', then above should be
  main_SOURCES = ...

but since you seem to build the thing in the src/ subdirectory, I would
not specify either of these lines here, but all in src/Makefile.am.

> AM_CXXFLAGS = -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include
> -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include
[...]
> AM_LDFLAGS = -lglademm-2.4 -lgtkmm-2.4 -lglade-2.0 -lgdkmm-2.4 -latkmm-1.6 
> -
[...]
> -lboost_thread -lboost_signals

Both of these settings apply only to the Makefile.am in which you put
them, so you should put them in src/Makefile.am if that's where they are
needed, or in an "include"d file if you need them in several Makefiles;
but actually I would not set them at all in a Makefile.am: have some
test in configure.ac that computes them (and lets the user override them
with options to configure).  Probably these packages use pkg-config
which can help you find out suitable values portably.

> My src/Makefile.am:
>
> SUBDIRS = Base Cairo Commands Draw Events IO Middleware RIPC Utils
> bin_PROGRAMS = hmi
> hmi_SOURCES = main.cpp

Again, you need the "bin_PROGRAMS = hmi" line only in one Makefile.am.

> Now, the question is.  What do I put in my Base/Makefile.am,

Start with empty files.  Go on from there, adding settings and rules for
stuff you want to get working.

Hope that helps.

Cheers,
Ralf




reply via email to

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