Vi.
Vi.

Reputation: 38694

How to affect order of targets, add additional steps etc. for Makefile.am?

Can I manage Makefile.am as I got used to manage Makefile?

Usually I create targets which calls each other in order to make the project built.

But in Makefile.am I have some mysterious libqqq_la_SOURCES = ... which I don't know what is it doing exactly.

Where to write what compiler should it use for the given source? Where to add a step that "qqq.c is generated from qqq.vala"?

How to write Makefile.am as just Makefile?

Upvotes: 1

Views: 427

Answers (2)

Adrian Petrescu
Adrian Petrescu

Reputation: 17959

Automake will automatically copy over any Make targets you specify in Makefile.am into the generated Makefile. So you can generate any custom, complicated things just by including it in the .am file.

However, you shouldn't do this for everything -- that defeats the benefit that Automake is trying to provide you. Specifying

bin_PROGRAMS=foo
AM_CFLAGS=$(DEPS_CFLAGS)
foo_SOURCES=file1.cpp file2.cpp
foo_LDADD=$(DEPS_LIBS)

will generate a standard Make target anyway. I recommend you learn to use Automake macros for most standard things -- it will be more portable that way.

The best way to learn the rich variety of Autotools features is not to read the manual -- it's way too complicated and unorganizable. My suggestion is simply to take an existing open-source GNU project that is similar in build style (dependencies, platforms, etc) to yours, and examine its Autoconf and Automake files. The established projects have learned quite a few tricks that you can learn from.

Upvotes: 0

user502515
user502515

Reputation: 4444

Automake in 1.11 does have Vala support.

configure.ac:

AM_PROG_VALAC

Makefile.am:

AM_VALAFLAGS = whateverelse
whatever_SOURCES = xxx.vala

Upvotes: 3

Related Questions