Commit | Line | Data |
---|---|---|
86c1c2e9 JT |
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 | ||
1f5e9bde JT |
5 | CMDGROUPS = default other |
6 | ||
a96ab628 JT |
7 | libdefault_la_SOURCES = default_client.cpp |
8 | libother_la_SOURCES = other_client.cpp | |
9 | noinst_LTLIBRARIES = libdefault.la libother.la | |
86c1c2e9 JT |
10 | |
11 | client_SOURCES = client.cpp | |
a96ab628 | 12 | client_LDADD = $(LDADD) libdefault.la libother.la |
86c1c2e9 | 13 | |
d8694b16 JT |
14 | server_SOURCES = server.cpp \ |
15 | other.cpp other_server.cpp \ | |
16 | default.cpp default_server.cpp \ | |
17 | foo.hxx | |
86c1c2e9 JT |
18 | |
19 | noinst_PROGRAMS = client server | |
20 | ||
1f5e9bde JT |
21 | |
22 | # always the same: | |
23 | ||
24 | codegen.stamp: $(CMDGROUPS:%=%.cpp) $(top_builddir)/codegen/codegen | |
a96ab628 | 25 | # assuming we have some unix like shell |
1f5e9bde | 26 | echo BUILT_SOURCES: $(BUILT_SOURCES) |
acf4b39c | 27 | for i in $(CMDGROUPS); do \ |
a96ab628 JT |
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 | |
acf4b39c | 32 | for i in $(CMDGROUPS); do \ |
a96ab628 JT |
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 | ||
1f5e9bde JT |
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)) ) | |
71ae912c | 39 | |
1f5e9bde | 40 | $(BUILT_SOURCES) : codegen.stamp |
acf4b39c | 41 | |
71ae912c | 42 | TESTS = test |
22c93e2c | 43 | |
7b541de9 | 44 | CLEANFILES = $(BUILT_SOURCES) codegen.stamp |
22c93e2c JT |
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 |