Hello,
I am trying to build a libtool library that is build from a bunch of
generated source files (with a .cxx extension) and a bunch of
distributed source files (with a .cpp extension). Until now, I have
added only one of the generated cxx files in the BUILD_SOURCE so the cxx
files were first generated and then compiled. All the cxx files are
generated from only one file (with a .stc extension) and one command
(called for example gencxx). So, until now I am using this kind of
Makefile.am :
lib_LTLIBRARIES = libtoto.la
BUILD_SOURCE = src/toto01.cxx
dist_libtoto_la_SOURCES = src/toto.stc
libtoto_la_SOURCES =src/toto01.cxx src/toto02.cxx src/toto.cpp
src/toto01.cxx: src/toto.stc
gencxx src/toto.stc
The problem with this approach is it is not robust with parallel
compilation and it is not possible to build only one *.lo file from
clean source if it is not the one used with the BUILD_SOURCE variable.
To get all of this features, I want to use a general rule to generate a
.cxx file depending only on one generated file (called diary.xml and
also generated by the gencxx file) and then writing a rule to build this
generated file. So, the Makefile.am would be:
lib_LTLIBRARIES = libtoto.la
dist_libtoto_la_SOURCES = src/toto.stc
libtoto_la_SOURCES =src/toto01.cxx src/toto02.cxx src/toto.cpp
%.cxx: src/diary.xml
src/diary.xml: src/toto.stc
gencxx src/toto.stc
The problem with this approach is that make returns the error :
*** No rule to make target 'src/toto01.cxx', needed by
'libtoto_la-toto01.lo'. Stop.
So, I guess the pattern %.cxx is not correct but I tried different
things and I can't make it work. Any ideas ?
Thanks,
Thomas