There's just a few issues with the use of <prefix>_
primaries:
lib_LTLIBRARIES = libsocket++.la
results in a derived variable name of libsocket__
libsocket___includedir = $(includedir)/socket++
libsocket___include_HEADERS = ...
libsocket___la_SOURCES = ...
You can put header files in the _SOURCES
list as well. i.e., if a header is changed, make
will see that the library, or other dependents, must be recompiled.
What you've called a 'phantom' target, is typically referred to as a convenience library, where: libsocket++types.la
transforms to the libsocket__types_
prefix. The parent Makefile.am
should add include paths to AM_CPPFLAGS
. Since subdirs
will be descended first, you can add the convenience library with:
libsocket___la_LIBADD = types/libsocket++types.la
Also, it's noinst_LTLIBRARIES
not noinst_lib_LTLIBRARIES
.