Commit | Line | Data |
---|---|---|
86c1c2e9 | 1 | INCLUDES = -I$(top_srcdir)/src @BOOST_CPPFLAGS@ @CPPUNIT_CFLAGS@ -I$(top_srcdir)/codegen |
86c1c2e9 JT |
2 | LDADD = $(top_builddir)/src/libt2n.la @BOOST_SERIALIZATION_LIB@ @BOOST_LDFLAGS@ |
3 | ||
1f5e9bde JT |
4 | CMDGROUPS = default other |
5 | ||
c5e54ff2 | 6 | default_GROUP = default.cpp |
3c4dd222 | 7 | # command example of group using multiple cpp files |
c5e54ff2 JT |
8 | other_GROUP = other-1.cpp other-2.cpp |
9 | ||
3c4dd222 JT |
10 | # foo.hxx must be listed manually |
11 | include_HEADERS = foo.hxx | |
12 | ||
0cfa3fb2 JT |
13 | # unfortunately we can't set those from variables |
14 | # because they are parsed by automake | |
15 | ||
a96ab628 JT |
16 | libdefault_la_SOURCES = default_client.cpp |
17 | libother_la_SOURCES = other_client.cpp | |
3c4dd222 JT |
18 | lib_LTLIBRARIES = libdefault.la libother.la |
19 | ||
86c1c2e9 | 20 | |
3c4dd222 | 21 | # build an example server and client |
86c1c2e9 | 22 | client_SOURCES = client.cpp |
a96ab628 | 23 | client_LDADD = $(LDADD) libdefault.la libother.la |
d8694b16 | 24 | server_SOURCES = server.cpp \ |
c5e54ff2 JT |
25 | $(other_GROUP) other_server.cpp \ |
26 | $(default_GROUP) default_server.cpp \ | |
d8694b16 | 27 | foo.hxx |
86c1c2e9 JT |
28 | noinst_PROGRAMS = client server |
29 | ||
3c4dd222 JT |
30 | # test script |
31 | ||
32 | TESTS = test | |
1f5e9bde JT |
33 | |
34 | # always the same: | |
35 | ||
3c4dd222 JT |
36 | include_HEADERS += $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx) |
37 | ||
4c298f07 | 38 | #IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j))) |
4c298f07 | 39 | |
3c4dd222 | 40 | -include $(foreach i, $(CMDGROUPS), .deps/group_$(i).P) |
4c298f07 JT |
41 | |
42 | .deps/group_%.P : Makefile.am | |
43 | echo $@ : $($*_GROUP) > .deps/group_$*.P | |
44 | ||
3c4dd222 | 45 | %.stamp : .deps/group_%.P $(top_builddir)/codegen/codegen |
c5e54ff2 | 46 | # assuming we have some unix like shell (maybe even bash) |
1f5e9bde | 47 | echo BUILT_SOURCES: $(BUILT_SOURCES) |
c5e54ff2 | 48 | cp -v $(top_srcdir)/codegen/codegen-stubhead.hxx $*_common.hxx; |
3c4dd222 | 49 | echo > $*_server.hxx; |
a96ab628 | 50 | # todo use tmp file for xml file |
c5e54ff2 JT |
51 | for i in $($*_GROUP); do \ |
52 | gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $${i} -fxml=$${i%*.cpp}.xml; \ | |
53 | done; \ | |
85106017 | 54 | $(top_builddir)/codegen/codegen $* $($*_GROUP:.cpp=.xml) && touch $@ |
a96ab628 | 55 | |
1f5e9bde JT |
56 | # assuming we have gnu make? |
57 | BUILT_SOURCES = $(foreach i, $(CMDGROUPS), $(foreach j, _common.hxx _common.cpp _client.hxx _client.cpp _server.hxx _server.cpp, $(i)$(j)) ) | |
71ae912c | 58 | |
3c4dd222 | 59 | STAMPS=$(CMDGROUPS:=.stamp) |
c5e54ff2 | 60 | $(BUILT_SOURCES) : $(STAMPS) |
acf4b39c | 61 | |
22c93e2c | 62 | |
c5e54ff2 | 63 | CLEANFILES = $(BUILT_SOURCES) $(STAMPS) |
3c4dd222 JT |
64 | |
65 | # Install the pkg-config files: | |
66 | pkgconfigdir = $(libdir)/pkgconfig | |
67 | pkgconfig_DATA = $(CMDGROUPS:=.pc) | |
68 | ||
69 | # .pc files (one pc file for each command group) | |
70 | %.pc : $(top_srcdir)/codegen/clientlib.pc.in Makefile | |
71 | sed \ | |
72 | -e 's,@CMDGROUP@,$*,g' \ | |
73 | -e 's,\@prefix\@,$(prefix),g' \ | |
74 | -e 's,\@exec_prefix\@,$(exec_prefix),g' \ | |
75 | -e 's,\@libdir\@,$(libdir),g' \ | |
76 | -e 's,\@includedir\@,$(includedir),g' \ | |
77 | $< >$*.pc |