Add first version
[ric-plt/sdl.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 BASE_CPPFLAGS = \
4     -Wall \
5     -Werror \
6     -Wextra \
7     -Wno-missing-field-initializers \
8     -I$(top_srcdir)/include \
9     -I$(builddir)/include \
10     -DSDL_CONF_DIR='"@SDL_CONF_DIR@"' \
11     $(BOOST_CPPFLAGS)
12
13 lib_LTLIBRARIES = \
14     libsdl.la \
15     libshareddatalayercli.la
16
17 libsdl_la_SOURCES = \
18     include/private/abort.hpp \
19     include/private/asyncconnection.hpp \
20     include/private/asyncdummystorage.hpp \
21     include/private/asyncstorageimpl.hpp \
22     include/private/createlogger.hpp \
23     include/private/configurationpaths.hpp \
24     include/private/configurationreader.hpp \
25     include/private/databaseconfiguration.hpp \
26     include/private/databaseconfigurationimpl.hpp \
27     include/private/engine.hpp \
28     include/private/engineimpl.hpp \
29     include/private/error.hpp \
30     include/private/eventfd.hpp \
31     include/private/filedescriptor.hpp \
32     include/private/hostandport.hpp \
33     include/private/logger.hpp \
34     include/private/namespaceconfiguration.hpp \
35     include/private/namespaceconfigurations.hpp \
36     include/private/namespaceconfigurationsimpl.hpp \
37     include/private/namespacevalidator.hpp \
38     include/private/syncstorageimpl.hpp \
39     include/private/system.hpp \
40     include/private/timer.hpp \
41     include/private/timerfd.hpp \
42     src/abort.cpp \
43     src/asyncconnection.cpp \
44     src/asyncdummystorage.cpp \
45     src/asyncstorage.cpp \
46     src/asyncstorageimpl.cpp \
47     src/backenderror.cpp \
48     src/configurationpaths.cpp \
49     src/configurationreader.cpp \
50     src/createlogger.cpp \
51     src/databaseconfiguration.cpp \
52     src/databaseconfigurationimpl.cpp \
53     src/emptynamespace.cpp \
54     src/engine.cpp \
55     src/engineimpl.cpp \
56     src/error.cpp \
57     src/errorqueries.cpp \
58     src/exception.cpp \
59     src/eventfd.cpp \
60     src/filedescriptor.cpp \
61     src/hostandport.cpp \
62     src/invalidnamespace.cpp \
63     src/namespacevalidator.cpp \
64     src/namespaceconfigurationsimpl.cpp \
65     src/notconnected.cpp \
66     src/operationinterrupted.cpp \
67     src/publisherid.cpp \
68     src/rejectedbybackend.cpp \
69     src/rejectedbysdl.cpp \
70     src/syncstorage.cpp \
71     src/syncstorageimpl.cpp \
72     src/system.cpp \
73     src/timer.cpp \
74     src/timerfd.cpp
75
76 if SYSTEMLOGGER
77 libsdl_la_SOURCES += \
78     include/private/systemlogger.hpp \
79     src/systemlogger.cpp
80 endif
81
82 if REDIS
83 libsdl_la_SOURCES += \
84     include/private/redis/asynccommanddispatcher.hpp \
85     include/private/redis/asyncdatabasediscovery.hpp \
86     include/private/redis/asyncredisreply.hpp \
87     include/private/redis/asyncredisstorage.hpp \
88     include/private/redis/contents.hpp \
89     include/private/redis/contentsbuilder.hpp \
90     include/private/redis/databaseinfo.hpp \
91     include/private/redis/reply.hpp \
92     src/redis/asynccommanddispatcher.cpp \
93     src/redis/asyncdatabasediscovery.cpp \
94     src/redis/asyncredisreply.cpp \
95     src/redis/asyncredisstorage.cpp \
96     src/redis/contentsbuilder.cpp
97 endif
98 if HIREDIS
99 libsdl_la_SOURCES += \
100     include/private/redis/asynchirediscommanddispatcher.hpp \
101     include/private/redis/asynchiredisdatabasediscovery.hpp \
102     include/private/redis/hiredisepolladapter.hpp \
103     include/private/redis/hiredissystem.hpp \
104     include/private/redis/redisgeneral.hpp \
105     src/redis/asynchirediscommanddispatcher.cpp \
106     src/redis/asynchiredisdatabasediscovery.cpp \
107     src/redis/hiredisepolladapter.cpp \
108     src/redis/hiredissystem.cpp \
109     src/redis/redisgeneral.cpp
110 endif
111 if HIREDIS_VIP
112 libsdl_la_SOURCES += \
113     include/private/redis/asynchiredisclustercommanddispatcher.hpp \
114     include/private/redis/hiredisclusterepolladapter.hpp \
115     include/private/redis/hiredisclustersystem.hpp \
116     src/redis/asynchiredisclustercommanddispatcher.cpp \
117     src/redis/hiredisclusterepolladapter.cpp \
118     src/redis/hiredisclustersystem.cpp
119 endif
120 libsdl_la_CPPFLAGS = \
121     $(BASE_CPPFLAGS) \
122     $(HIREDIS_CFLAGS) \
123     $(HIREDIS_VIP_CFLAGS)
124 libsdl_la_LDFLAGS = \
125     $(BOOST_LDFLAGS) \
126     -version-info @SDL_LT_VERSION@
127 libsdl_la_LIBADD = \
128     $(BOOST_SYSTEM_LIB) \
129     $(BOOST_FILESYSTEM_LIB) \
130     $(HIREDIS_LIBS) \
131     $(HIREDIS_VIP_LIBS)
132
133 libshareddatalayercli_la_SOURCES = \
134     src/cli/commandmap.cpp \
135     src/cli/commandparserandexecutor.cpp \
136     src/cli/dumpconfigurationcommand.cpp \
137     src/cli/testgetsetcommand.cpp \
138     src/cli/testconnectivitycommand.cpp \
139     src/exception.cpp \
140     src/configurationpaths.cpp \
141     include/private/configurationpaths.hpp \
142     include/private/cli/commandmap.hpp \
143     include/private/cli/commandparserandexecutor.hpp
144
145 libshareddatalayercli_la_CPPFLAGS = \
146     $(BASE_CPPFLAGS) \
147     $(PTHREAD_CFLAGS) \
148     $(BOOST_CPPFLAGS)
149 libshareddatalayercli_la_LDFLAGS = \
150     $(BOOST_LDFLAGS) \
151     $(PTHREAD_CFLAGS) \
152     -release $(PACKAGE_VERSION)
153 libshareddatalayercli_la_LIBADD = \
154     $(BOOST_FILESYSTEM_LIB) \
155     $(BOOST_PROGRAM_OPTIONS_LIB) \
156     $(BOOST_SYSTEM_LIB) \
157     $(PTHREAD_LIBS) \
158     -lboost_system \
159     -lpthread \
160     libsdl.la
161
162 pkgincludedir = \
163     $(includedir)/sdl
164 pkginclude_HEADERS = \
165     include/sdl/asyncstorage.hpp \
166     include/sdl/backenderror.hpp \
167     include/sdl/doxygen.hpp \
168     include/sdl/emptynamespace.hpp \
169     include/sdl/errorqueries.hpp \
170     include/sdl/exception.hpp \
171     include/sdl/invalidnamespace.hpp \
172     include/sdl/notconnected.hpp \
173     include/sdl/operationinterrupted.hpp \
174     include/sdl/publisherid.hpp \
175     include/sdl/rejectedbybackend.hpp \
176     include/sdl/rejectedbysdl.hpp \
177     include/sdl/syncstorage.hpp
178
179 pkgconfigdir = \
180     ${libdir}/pkgconfig
181 nodist_pkgconfig_DATA = \
182     libsdl.pc
183
184 libsdl.pc: $(top_srcdir)/libsdl.pc.in
185         sed -e 's![@]prefix[@]!$(prefix)!g' \
186         -e 's![@]exec_prefix[@]!$(exec_prefix)!g' \
187         -e 's![@]includedir[@]!$(includedir)!g' \
188         -e 's![@]pkglibexecdir[@]!$(pkglibexecdir)!g' \
189         -e 's![@]libdir[@]!$(libdir)!g' \
190         -e 's![@]confdir[@]!@SDL_CONF_DIR@!g' \
191         -e 's![@]PACKAGE_VERSION[@]!$(PACKAGE_VERSION)!g' \
192         -e 's![@]PACKAGE_URL[@]!$(PACKAGE_URL)!g' \
193         $< > $@
194
195 bin_PROGRAMS = \
196     sdltool
197
198 sdltool_SOURCES = \
199     src/cli/main.cpp
200 sdltool_CPPFLAGS = \
201     $(BASE_CPPFLAGS) \
202     $(PTHREAD_CFLAGS) \
203     $(BOOST_CPPFLAGS)
204 sdltool_LDFLAGS = \
205     $(PTHREAD_CFLAGS) \
206     $(BOOST_LDFLAGS)
207 sdltool_LDADD = \
208     $(BOOST_PROGRAM_OPTIONS_LIB) \
209     libsdl.la \
210     $(PTHREAD_LIBS) \
211     -lboost_system \
212     libshareddatalayercli.la
213
214 check_LTLIBRARIES = \
215     libgmock.la libgtest.la
216
217 libgmock_la_SOURCES = \
218     3rdparty/googletest/googlemock/src/gmock-all.cc \
219     3rdparty/googletest/googlemock/src/gmock-cardinalities.cc \
220     3rdparty/googletest/googlemock/src/gmock.cc \
221     3rdparty/googletest/googlemock/src/gmock-internal-utils.cc \
222     3rdparty/googletest/googlemock/src/gmock_main.cc \
223     3rdparty/googletest/googlemock/src/gmock-matchers.cc \
224     3rdparty/googletest/googlemock/src/gmock-spec-builders.cc \
225     3rdparty/googletest/googlemock/include/gmock/gmock-actions.h \
226     3rdparty/googletest/googlemock/include/gmock/gmock-cardinalities.h \
227     3rdparty/googletest/googlemock/include/gmock/gmock-generated-actions.h \
228     3rdparty/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h \
229     3rdparty/googletest/googlemock/include/gmock/gmock-generated-matchers.h \
230     3rdparty/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h \
231     3rdparty/googletest/googlemock/include/gmock/gmock.h \
232     3rdparty/googletest/googlemock/include/gmock/gmock-matchers.h \
233     3rdparty/googletest/googlemock/include/gmock/gmock-more-actions.h \
234     3rdparty/googletest/googlemock/include/gmock/gmock-more-matchers.h \
235     3rdparty/googletest/googlemock/include/gmock/gmock-spec-builders.h \
236     3rdparty/googletest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h \
237     3rdparty/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h \
238     3rdparty/googletest/googlemock/include/gmock/internal/gmock-port.h \
239     3rdparty/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h \
240     3rdparty/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h \
241     3rdparty/googletest/googlemock/include/gmock/internal/custom/gmock-port.h
242
243 libgmock_la_CPPFLAGS = \
244     $(PTHREAD_CFLAGS) \
245     -I$(top_srcdir)/3rdparty/googletest/googlemock/include/ \
246     -I$(top_srcdir)/3rdparty/googletest/googlemock/ \
247     -I$(top_srcdir)/3rdparty/googletest/googletest/include/
248 libgmock_la_LDFLAGS = \
249     $(PTHREAD_CFLAGS)
250 libgmock_la_LIBADD = \
251     $(PTHREAD_LIBS)
252
253 libgtest_la_SOURCES = \
254     3rdparty/googletest/googletest/src/gtest-all.cc \
255     3rdparty/googletest/googletest/src/gtest.cc \
256     3rdparty/googletest/googletest/src/gtest-death-test.cc \
257     3rdparty/googletest/googletest/src/gtest-filepath.cc \
258     3rdparty/googletest/googletest/src/gtest-internal-inl.h \
259     3rdparty/googletest/googletest/src/gtest_main.cc \
260     3rdparty/googletest/googletest/src/gtest-port.cc \
261     3rdparty/googletest/googletest/src/gtest-printers.cc \
262     3rdparty/googletest/googletest/src/gtest-test-part.cc \
263     3rdparty/googletest/googletest/src/gtest-typed-test.cc \
264     3rdparty/googletest/googletest/include/gtest/gtest-death-test.h \
265     3rdparty/googletest/googletest/include/gtest/gtest.h \
266     3rdparty/googletest/googletest/include/gtest/gtest-message.h \
267     3rdparty/googletest/googletest/include/gtest/gtest-param-test.h \
268     3rdparty/googletest/googletest/include/gtest/gtest-param-test.h.pump \
269     3rdparty/googletest/googletest/include/gtest/gtest_pred_impl.h \
270     3rdparty/googletest/googletest/include/gtest/gtest-printers.h \
271     3rdparty/googletest/googletest/include/gtest/gtest_prod.h \
272     3rdparty/googletest/googletest/include/gtest/gtest-spi.h \
273     3rdparty/googletest/googletest/include/gtest/gtest-test-part.h \
274     3rdparty/googletest/googletest/include/gtest/gtest-typed-test.h \
275     3rdparty/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h \
276     3rdparty/googletest/googletest/include/gtest/internal/gtest-filepath.h \
277     3rdparty/googletest/googletest/include/gtest/internal/gtest-internal.h \
278     3rdparty/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h \
279     3rdparty/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h \
280     3rdparty/googletest/googletest/include/gtest/internal/gtest-param-util.h \
281     3rdparty/googletest/googletest/include/gtest/internal/gtest-port-arch.h \
282     3rdparty/googletest/googletest/include/gtest/internal/gtest-port.h \
283     3rdparty/googletest/googletest/include/gtest/internal/gtest-string.h \
284     3rdparty/googletest/googletest/include/gtest/internal/gtest-tuple.h \
285     3rdparty/googletest/googletest/include/gtest/internal/gtest-type-util.h \
286     3rdparty/googletest/googletest/include/gtest/internal/custom/gtest.h \
287     3rdparty/googletest/googletest/include/gtest/internal/custom/gtest-port.h \
288     3rdparty/googletest/googletest/include/gtest/internal/custom/gtest-printers.h
289
290 libgtest_la_CPPFLAGS = \
291     $(PTHREAD_CFLAGS) \
292     -I$(top_srcdir)/3rdparty/googletest/googletest/include/ \
293     -I$(top_srcdir)/3rdparty/googletest/googletest/
294 libgtest_la_LDFLAGS = \
295     $(PTHREAD_CFLAGS)
296 libgtest_la_LIBADD = \
297     $(PTHREAD_LIBS)
298
299 check_PROGRAMS = \
300     testrunner
301
302 testrunner_SOURCES = \
303     include/private/tst/asyncstoragemock.hpp \
304     include/private/tst/databaseconfigurationmock.hpp \
305     include/private/tst/enginemock.hpp \
306     include/private/tst/gettopsrcdir.hpp \
307     include/private/tst/namespaceconfigurationsmock.hpp \
308     include/private/tst/systemmock.hpp \
309     include/private/tst/wellknownerrorcode.hpp \
310     tst/abort_test.cpp \
311     tst/asyncdummystorage_test.cpp \
312     tst/asyncstorage_test.cpp \
313     tst/backenderror_test.cpp \
314     tst/configurationreader_test.cpp \
315     tst/databaseconfiguration_test.cpp \
316     tst/databaseconfigurationimpl_test.cpp \
317     tst/emptynamespace_test.cpp \
318     tst/engine_test.cpp \
319     tst/engineimpl_test.cpp \
320     tst/error_test.cpp \
321     tst/errorqueries_test.cpp \
322     tst/eventfd_test.cpp \
323     tst/gettopsrcdir.cpp \
324     tst/filedescriptor_test.cpp \
325     tst/hostandport_test.cpp \
326     tst/invalidnamespace_test.cpp \
327     tst/main.cpp \
328     tst/namespaceconfigurations_test.cpp \
329     tst/namespaceconfigurationsimpl_test.cpp \
330     tst/namespacevalidator_test.cpp \
331     tst/publisherid_test.cpp \
332     tst/syncstorage_test.cpp \
333     tst/syncstorageimpl_test.cpp \
334     tst/system_test.cpp \
335     tst/timer_test.cpp \
336     tst/timerfd_test.cpp \
337     tst/wellknownerrorcode.cpp
338 if REDIS
339 testrunner_SOURCES += \
340     include/private/tst/asynccommanddispatchermock.hpp \
341     include/private/tst/asyncdatabasediscoverymock.hpp \
342     include/private/tst/contentsbuildermock.hpp \
343     include/private/tst/redisreplybuilder.hpp \
344     include/private/tst/replymock.hpp \
345     tst/asynccommanddispatcher_test.cpp \
346     tst/asyncdatabasediscovery_test.cpp \
347     tst/asyncredisstorage_test.cpp \
348     tst/asyncstorageimpl_test.cpp \
349     tst/contents_test.cpp \
350     tst/contentsbuilder_test.cpp \
351     tst/databaseinfo_test.cpp \
352     tst/redisgeneral_test.cpp \
353     tst/redisreplybuilder.cpp \
354     tst/reply_test.cpp
355 endif
356 if HIREDIS
357 testrunner_SOURCES += \
358     include/private/tst/hiredisepolladaptermock.hpp \
359     include/private/tst/hiredissystemmock.hpp \
360     tst/asynchirediscommanddispatcher_test.cpp \
361     tst/asynchiredisdatabasediscovery_test.cpp \
362     tst/hiredisepolladapter_test.cpp \
363     tst/hiredissystem_test.cpp
364 endif
365 if HIREDIS_VIP
366 testrunner_SOURCES += \
367     include/private/tst/hiredisclusterepolladaptermock.hpp \
368     include/private/tst/hiredisclustersystemmock.hpp \
369     tst/asynchiredisclustercommanddispatcher_test.cpp \
370     tst/hiredisclusterepolladapter_test.cpp \
371     tst/hiredisclustersystem_test.cpp
372 endif
373 testrunner_CPPFLAGS = \
374     $(BASE_CPPFLAGS) \
375     -I$(top_srcdir)/3rdparty/googletest/googlemock/include \
376     -I$(top_srcdir)/3rdparty/googletest/googletest/include \
377     $(HIREDIS_CFLAGS) \
378     $(HIREDIS_VIP_CFLAGS)
379 testrunner_LDADD = \
380     libsdl.la \
381     libgmock.la \
382     libgtest.la
383
384 TESTS = \
385     run-tests.sh
386
387 test: testrunner
388         ./run-tests.sh
389
390 clean-local:
391         rm -f libsdl.pc
392
393 @DX_RULES@
394
395 MOSTLYCLEANFILES = \
396     $(DX_CLEANFILES)
397
398 EXTRA_DIST = \
399     $(top_srcdir)/libsdl.pc.in \
400     $(top_srcdir)/tst/valgrind-suppressions.conf \
401     $(top_srcdir)/LICENSES.txt
402
403 AUTOMAKE_OPTIONS = \
404     serial-tests