X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=example-codegen%2FMakefile.am;h=4318ca6cd3cd314b2c5c7b32565ba679ca3d9d39;hp=72f25e53941f18445dca68b41ace00a407a63e9d;hb=0cfa3fb24104428b6e6d8881b1f94fcad825c7ef;hpb=22c93e2cd435ba875778fedef9b11181dd6383d1 diff --git a/example-codegen/Makefile.am b/example-codegen/Makefile.am index 72f25e5..4318ca6 100644 --- a/example-codegen/Makefile.am +++ b/example-codegen/Makefile.am @@ -2,6 +2,11 @@ INCLUDES = -I$(top_srcdir)/src @BOOST_CPPFLAGS@ @CPPUNIT_CFLAGS@ -I$(top_srcdir) LDADD = $(top_builddir)/src/libt2n.la @BOOST_SERIALIZATION_LIB@ @BOOST_LDFLAGS@ +CMDGROUPS = default other + +# unfortunately we can't set those from variables +# because they are parsed by automake + libdefault_la_SOURCES = default_client.cpp libother_la_SOURCES = other_client.cpp noinst_LTLIBRARIES = libdefault.la libother.la @@ -9,27 +14,37 @@ noinst_LTLIBRARIES = libdefault.la libother.la client_SOURCES = client.cpp client_LDADD = $(LDADD) libdefault.la libother.la -server_SOURCES = server.cpp other_server.cpp default_server.cpp other.cpp default.cpp foo.hxx +server_SOURCES = server.cpp \ + other.cpp other_server.cpp \ + default.cpp default_server.cpp \ + foo.hxx noinst_PROGRAMS = client server -codegen.stamp: default.cpp other.cpp $(top_builddir)/codegen/codegen + +# always the same: + +codegen.stamp: $(CMDGROUPS:%=%.cpp) $(top_builddir)/codegen/codegen # assuming we have some unix like shell - for i in default other; do \ + echo BUILT_SOURCES: $(BUILT_SOURCES) + for i in $(CMDGROUPS); do \ cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $${i}_common.hxx; \ cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $${i}_server.hxx; \ done # todo use tmp file for xml file - for i in default other; do \ + for i in $(CMDGROUPS); do \ gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $${i}.cpp -fxml=$${i}.xml; \ - $(top_builddir)/codegen/codegen $${i}.cpp $${i}.xml $${i}; \ + $(top_builddir)/codegen/codegen $${i}.cpp $${i} $${i}.xml; \ done; touch $@ -default_common.hxx default_common.cpp default_client.hxx default_client.cpp default_server.hxx default_server.cpp: codegen.stamp -other_common.hxx other_common.cpp other_client.hxx other_client.cpp other_server.hxx other_server.cpp: codegen.stamp +# assuming we have gnu make? +BUILT_SOURCES = $(foreach i, $(CMDGROUPS), $(foreach j, _common.hxx _common.cpp _client.hxx _client.cpp _server.hxx _server.cpp, $(i)$(j)) ) + +$(BUILT_SOURCES) : codegen.stamp TESTS = test +CLEANFILES = $(BUILT_SOURCES) codegen.stamp # TODO: # howto generate Makefile(.in) from something like this: