1
votes

I am trying to write a Makefile.am to link many static libraries into one single library (no extra source code is needed, I just want a library merge). Here is my Makefile.am file:

#target lib xxxx linking yyyy and zzzz libs (no source at this level):          
noinst_LTLIBRARIES = lib_xxxx.la                                     
lib_xxxx_la_SOURCES =                                                

#member libs:                                                             
SUBDIRS = yyyy                                                               
lib_xxxx_la_LIBADD = yyyy/yyyy.la 

SUBDIRS += zzzz                                                                
lib_zzzz_la_LIBADD = zzzz/zzzz.la 

I get 'No rule to make target 'all'. Even if I suppress the line:

lib_xxxx_la_SOURCES =    

How to I tel automake to do that?

2

2 Answers

0
votes

Library merges don't work like that in automake. Your library is a noinst one, which means that if there is no other reason for it to be built, it won't.

Also, the way you're declaring the libraries, it is unlikely to do what you intend to do. Particularly any flag used to define the original library will be ignored, as the new library will use the archive rather than the shared object.

It would be simpler if you defined what you're trying to do, and most importantly why, because I don't think there are many (if any) good reasons to try something like this.

-1
votes

The Makefile.am in my question (including the lib_xxxx_la_SOURCES = line does actualy work, it seems, when using a fresher version of autotools ( and a complete new project if that matters).