Makefile.am's assignment

 

This is la qucik reference of Makefile.am's assignment.

1. _LDFLAGS
This variable is used to pass extra flags to the link step of a program or a shared library.
2. _LDADD
List other object files and libraries that you want to link in with all of your executables. Use the -l flag only for installed libraries. You can list libraries that have been built but not installed yet as well, but does this only be providing the full path to these libraries. _LDADD and _LIBADD are inappropriate for passing program-specific linker flags (except for ‘-l’, ‘-L’, ‘-dlopen’ and ‘-dlpreopen’). Use the _LDFLAGS variable for this purpose.
3. _DEPENDENCIES
It is also occasionally useful to have a program depend on some other target that is not actually part of that program. If it is not supplied, it is computed by Automake. The automatically-assigned value is the contents of ‘_LDADD’ or ‘_LIBADD’, with most configure substitutions, ‘-l’, ‘-L’, ‘-dlopen’ and ‘-dlpreopen’ options removed.
4. CPPFLAGS / AM_CPPFLAGS / mumble_CPPFLAGS
CCASFLAGS, CFLAGS, CPPFLAGS, CXXFLAGS, FCFLAGS, FFLAGS, GCJFLAGS, LDFLAGS, LFLAGS, OBJCFLAGS, RFLAGS, YFLAGS.
CPPFLAGS, AM_CPPFLAGS, and mumble_CPPFLAGS are three variables that can be used to pass flags to the C preprocessor. CPPFLAGS is a variable that user are entitled to modify it. Never use it in Makefile.am! For instance, someone can do this to specify it like this:
./configure CPPFLAGS=’-I /home/my/usr/include’
AM_CPPFLAGS is ignored in preference to a per-executable (or per-library) _CPPFLAGS variable if it is defined.
5. INCLUDES = -I/dir1 -I/dir2 -I/dir3 ...
Insert the -I flags that you need to pass to your compiler. This does the same job as AM_CPPFLAGS, and this variable is deprecated.
6. SUBDIRS = dir1 dir2 …
Make sure that the subdirectory is built before the current directory is built. Be careful that subdirectories are always built in the order they appear.
7. bin_PROGRAMS = prog1 prog2 prog3
Lists all the executable files that will be compiled with make and installed with make install under `/prefix/bin', where `prefix' is usually `/usr/local'.
For each Program:
a) prog1_SOURCES = foo1.cc foo2.cc ... header1.h header2…
Here you list all the `*.cc' and `*.h' files that compose the source code of the program. The present of a header file here doesn't cause the file to be installed at `/prefix/include'. To cause header files to be installed you must also put them in `include_HEADERS'.
b) prog1_LDADD = -llib1 -llib2 -llib3…or obj1 obj2 …
c) prog1_LDFLAGS = -L/dir1 -L/dir2 -L/dir3 ...
d) prog1_DEPENDENCIES = dep1 dep2 dep3 ...
If for any reason you want certain other targets to be built before building this program, you can list them here.
8. lib_LTLIBRARIES = libfoo.la
Build libtool libraries.
9. noinst_LTLIBRARIES = libfoo.la
Creat Libtool convenience libraries with Automake.
10. lib_LIBRARIES = libfoo1.a libfoo2.a libfoo3.a ...
Lists all the library files that will be compiled with make and installed with make install under `/prefix/lib'.
The noinst symbol suggests that the primitive should not be installed.
For example: noinst_ LIBRARIES = lib1.a
For each library
e) libfoo1_a_SOURCES = foo1.cc foo2.cc private1.h private2.h ...
f) libfoo1_a_LIBADD = obj1.o obj2.o obj3.o
If there are any other object files that you want to include in the library list them here. You might be tempted to list them as dependencies in `libfoo1_a_DEPENDENCIES', but that will not work. If you do that, the object files will be built before the library is built but they will not be included in the library!
g) libfoo1_a_DEPENDENCIES = dep1 dep2 dep3 ...
If there are any other targets that need to be built before this library is built, list them here.
11. check_PROGRAMS = test1 test2 test3 ...
Lists executable files that are not compiled with a simple make but only with a make check. These programs serve as tests that you, the user can use to test the library.
12. TESTS = $(check_PROGRAMS)
It is common to just set TESTS = $(check_PROGRAMS), This way by commenting the line in and out, you can modify the behaviour of make check easily.
13. EXTRA_DIST
If a primary is not distributed by default, but in your case it ought to be, you can easily correct it with `EXTRA_DIST'
14. include_HEADERS = header1.h header2.h ...
Lists public headers present in this directory that you want to install in /prefix/include.

Related Entries

Post a Comment