3d710d5e20864eec9f1355897ad34dfbc637e04a
[libt2n] / example-codegen / Makefile.am
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 libdefault_la_SOURCES = default_client.cpp
6 libother_la_SOURCES = other_client.cpp
7 noinst_LTLIBRARIES = libdefault.la libother.la
8
9 client_SOURCES = client.cpp
10 client_LDADD = $(LDADD) libdefault.la libother.la
11
12 client.cpp : default_client.hxx other_client.hxx
13 server.cpp : default_client.hxx other_client.hxx
14
15 server_SOURCES = server.cpp \
16         other.cpp other_server.cpp \
17         default.cpp default_server.cpp \
18         foo.hxx
19
20 noinst_PROGRAMS = client server
21
22 codegen.stamp: default.cpp other.cpp $(top_builddir)/codegen/codegen
23 # assuming we have some unix like shell
24         for i in default other; do \
25                 cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $${i}_common.hxx; \
26                 cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $${i}_server.hxx; \
27         done
28 # todo use tmp file for xml file
29         for i in default other; do \
30                 gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $${i}.cpp -fxml=$${i}.xml; \
31                 $(top_builddir)/codegen/codegen $${i}.cpp $${i}.xml $${i}; \
32         done; touch $@
33
34 DEFAULT_GENERATED = default_common.hxx default_common.cpp default_client.hxx default_client.cpp default_server.hxx default_server.cpp
35 $(DEFAULT_GENERATED): codegen.stamp
36
37 OTHER_GENERATED = other_common.hxx other_common.cpp other_client.hxx other_client.cpp other_server.hxx other_server.cpp
38 $(OTHER_GENERATED): codegen.stamp
39
40 TESTS = test
41
42 CLEANFILES = $(DEFAULT_GENERATED) $(OTHER_GENERATED) codegen.stamp
43
44 # TODO:
45 # howto generate Makefile(.in) from something like this:
46
47 # CMDGROUPS = default other
48
49 # default_SOURCES = default-1.cpp default-2.cpp
50 # other_SOURCES = other.cpp
51
52 # TESTS = test
53
54 # server_SOURCES = server.cpp default foo.hxx