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