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