1
votes

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?

2
Why are you using Automake if you don't know what it's doing and you are comfortable using makefiles directly? What is your goal? - Peter Eisentraut
Because of I'm editing the project that uses automake. (New version is actually using qmake, so I'll probably just migrate) - Vi.

2 Answers

3
votes

Automake in 1.11 does have Vala support.

configure.ac:

AM_PROG_VALAC

Makefile.am:

AM_VALAFLAGS = whateverelse
whatever_SOURCES = xxx.vala
0
votes

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.