| 1 | INCLUDES = -I$(top_srcdir)/src @BOOST_CPPFLAGS@ @CPPUNIT_CFLAGS@ -I$(top_srcdir)/codegen |
| 2 | |
| 3 | LDADD = $(top_builddir)/src/libt2n.la @BOOST_SERIALIZATION_LIB@ @BOOST_LDFLAGS@ |
| 4 | |
| 5 | CMDGROUPS = default other |
| 6 | |
| 7 | libdefault_la_SOURCES = default_client.cpp |
| 8 | libother_la_SOURCES = other_client.cpp |
| 9 | noinst_LTLIBRARIES = libdefault.la libother.la |
| 10 | |
| 11 | client_SOURCES = client.cpp |
| 12 | client_LDADD = $(LDADD) libdefault.la libother.la |
| 13 | |
| 14 | server_SOURCES = server.cpp \ |
| 15 | other.cpp other_server.cpp \ |
| 16 | default.cpp default_server.cpp \ |
| 17 | foo.hxx |
| 18 | |
| 19 | noinst_PROGRAMS = client server |
| 20 | |
| 21 | |
| 22 | # always the same: |
| 23 | |
| 24 | codegen.stamp: $(CMDGROUPS:%=%.cpp) $(top_builddir)/codegen/codegen |
| 25 | # assuming we have some unix like shell |
| 26 | echo BUILT_SOURCES: $(BUILT_SOURCES) |
| 27 | for i in $(CMDGROUPS); do \ |
| 28 | cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $${i}_common.hxx; \ |
| 29 | cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $${i}_server.hxx; \ |
| 30 | done |
| 31 | # todo use tmp file for xml file |
| 32 | for i in $(CMDGROUPS); do \ |
| 33 | gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $${i}.cpp -fxml=$${i}.xml; \ |
| 34 | $(top_builddir)/codegen/codegen $${i}.cpp $${i}.xml $${i}; \ |
| 35 | done; touch $@ |
| 36 | |
| 37 | # assuming we have gnu make? |
| 38 | BUILT_SOURCES = $(foreach i, $(CMDGROUPS), $(foreach j, _common.hxx _common.cpp _client.hxx _client.cpp _server.hxx _server.cpp, $(i)$(j)) ) |
| 39 | |
| 40 | $(BUILT_SOURCES) : codegen.stamp |
| 41 | |
| 42 | TESTS = test |
| 43 | |
| 44 | CLEANFILES = $(BUILT_SOURCES) codegen.stamp |
| 45 | |
| 46 | # TODO: |
| 47 | # howto generate Makefile(.in) from something like this: |
| 48 | |
| 49 | # CMDGROUPS = default other |
| 50 | |
| 51 | # default_SOURCES = default-1.cpp default-2.cpp |
| 52 | # other_SOURCES = other.cpp |
| 53 | |
| 54 | # TESTS = test |
| 55 | |
| 56 | # server_SOURCES = server.cpp default foo.hxx |