X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=example-codegen%2FMakefile.am;h=3cc4d3d001324a707a975012000e376adb8dcb5c;hp=14cd67d31710b0984c9b39a9f25ac64b39018ed3;hb=b6ead8d8d4d86e659e6d9f3a49a1b17947d47863;hpb=6e27f586ddced58bf12fec79cf5d8bf467400c66 diff --git a/example-codegen/Makefile.am b/example-codegen/Makefile.am index 14cd67d..3cc4d3d 100644 --- a/example-codegen/Makefile.am +++ b/example-codegen/Makefile.am @@ -9,7 +9,8 @@ default_GROUP = default.cpp # example of a command group using multiple cpp files other_GROUP = other-1.cpp other-2.cpp -# foo.hxx must be listed manually +# headers declaring data types used as rpc arguments must be listed manually +# (in this example the class Foo) include_HEADERS = foo.hxx # unfortunately we can't set those from variables @@ -25,8 +26,7 @@ client_LDADD = $(LDADD) libdefault.la libother.la server_SOURCES = server.cpp \ $(other_GROUP) other_server.cpp \ - $(default_GROUP) default_server.cpp \ - foo.hxx + $(default_GROUP) default_server.cpp noinst_PROGRAMS = client server @@ -34,6 +34,9 @@ noinst_PROGRAMS = client server TESTS = test + + + # always the same: include_HEADERS += $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx) @@ -48,8 +51,9 @@ include_HEADERS += $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx) %.stamp : .deps/group_%.P $(top_builddir)/codegen/codegen # assuming we have some unix like shell (maybe even bash) echo BUILT_SOURCES: $(BUILT_SOURCES) - cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $*_common.hxx; - echo > $*_server.hxx; +# temporarily create _common.hxx file (will be overwritten by codegen below) + echo '#include "codegen-stubhead.hxx"' > $*_common.hxx; + echo '#include "$*.hxx"' >> $*_common.hxx; # todo use tmp file for xml file for i in $($*_GROUP); do \ gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $${i} -fxml=$${i%*.cpp}.xml; \ @@ -77,3 +81,9 @@ pkgconfig_DATA = $(CMDGROUPS:=.pc) $< >$*.pc CLEANFILES = $(BUILT_SOURCES) $(STAMPS) $(pkgconfig_DATA) + +# didn't work (same problem as with _LTLIBRARIES [parsing by automake], +# this time _OBJECTS was not correct) +# server_SOURCES = server.cpp \ +# $(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j))) \ +# $(foreach i, $(CMDGROUPS), $(i)_server.cpp)