| 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 | default_GROUP = default.cpp |
| 8 | other_GROUP = other-1.cpp other-2.cpp |
| 9 | |
| 10 | # unfortunately we can't set those from variables |
| 11 | # because they are parsed by automake |
| 12 | |
| 13 | libdefault_la_SOURCES = default_client.cpp |
| 14 | libother_la_SOURCES = other_client.cpp |
| 15 | noinst_LTLIBRARIES = libdefault.la libother.la |
| 16 | |
| 17 | client_SOURCES = client.cpp |
| 18 | client_LDADD = $(LDADD) libdefault.la libother.la |
| 19 | |
| 20 | server_SOURCES = server.cpp \ |
| 21 | $(other_GROUP) other_server.cpp \ |
| 22 | $(default_GROUP) default_server.cpp \ |
| 23 | foo.hxx |
| 24 | |
| 25 | noinst_PROGRAMS = client server |
| 26 | |
| 27 | |
| 28 | # always the same: |
| 29 | |
| 30 | #IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j))) |
| 31 | STAMPS=$(CMDGROUPS:=.stamp) |
| 32 | |
| 33 | GROUPDEP_FILES = $(foreach i, $(CMDGROUPS), .deps/group_$(i).P) |
| 34 | -include $(GROUPDEP_FILES) |
| 35 | |
| 36 | .deps/group_%.P : Makefile.am |
| 37 | echo $@ : $($*_GROUP) > .deps/group_$*.P |
| 38 | |
| 39 | %.stamp : .deps/group_%.P $(top_builddir)/codegen/codegen Makefile.am |
| 40 | # assuming we have some unix like shell (maybe even bash) |
| 41 | echo BUILT_SOURCES: $(BUILT_SOURCES) |
| 42 | cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $*_common.hxx; |
| 43 | cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $*_server.hxx; |
| 44 | # todo use tmp file for xml file |
| 45 | for i in $($*_GROUP); do \ |
| 46 | gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $${i} -fxml=$${i%*.cpp}.xml; \ |
| 47 | done; \ |
| 48 | $(top_builddir)/codegen/codegen $* $($*_GROUP:.cpp=.xml) && touch $@ |
| 49 | |
| 50 | # assuming we have gnu make? |
| 51 | BUILT_SOURCES = $(foreach i, $(CMDGROUPS), $(foreach j, _common.hxx _common.cpp _client.hxx _client.cpp _server.hxx _server.cpp, $(i)$(j)) ) |
| 52 | |
| 53 | $(BUILT_SOURCES) : $(STAMPS) |
| 54 | |
| 55 | TESTS = test |
| 56 | |
| 57 | CLEANFILES = $(BUILT_SOURCES) $(STAMPS) |