Code

frontend: Connection-specific functions now use the sdb_conn_ prefix.
[sysdb.git] / src / Makefile.am
1 SUBDIRS = liboconfig
3 # coverage related flags are only set when gcov is enabled
4 AM_CFLAGS = @STRICT_CFLAGS@ @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@
5 AM_CXXFLAGS = @STRICT_CXXFLAGS@ @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@
6 AM_LDFLAGS = @COVERAGE_LDFLAGS@ @PROFILING_LDFLAGS@
7 AM_CPPFLAGS  = -I${top_builddir}/src/include -I${top_srcdir}/src/include
8 AM_CPPFLAGS += -DSYSCONFDIR='"${sysconfdir}"'
9 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
10 AM_CPPFLAGS += -DPKGLIBDIR='"${pkglibdir}"'
12 AM_YFLAGS = -d
14 BUILT_SOURCES = include/client/sysdb.h include/sysdb.h \
15                 parser/grammar.h
16 EXTRA_DIST = include/client/sysdb.h.in include/sysdb.h.in
18 pkginclude_HEADERS = include/sysdb.h
19 pkgcoreincludedir = $(pkgincludedir)/core
20 pkgcoreinclude_HEADERS = \
21                 include/core/data.h \
22                 include/core/object.h \
23                 include/core/plugin.h \
24                 include/core/store.h \
25                 include/core/time.h \
26                 include/core/timeseries.h
27 pkgfeincludedir = $(pkgincludedir)/frontend
28 pkgfeinclude_HEADERS = \
29                 include/frontend/connection.h \
30                 include/frontend/proto.h \
31                 include/frontend/sock.h
32 pkgutilsincludedir = $(pkgincludedir)/utils
33 pkgutilsinclude_HEADERS = \
34                 include/utils/avltree.h \
35                 include/utils/channel.h \
36                 include/utils/dbi.h \
37                 include/utils/error.h \
38                 include/utils/llist.h \
39                 include/utils/os.h \
40                 include/utils/proto.h \
41                 include/utils/ssl.h \
42                 include/utils/strbuf.h \
43                 include/utils/unixsock.h
45 pkgclientincludedir = $(pkgincludedir)/client
46 pkgclientinclude_HEADERS = \
47                 include/client/sock.h \
48                 include/client/sysdb.h
50 noinst_LTLIBRARIES = libsysdbclient.la libsysdb.la
52 libsysdbclient_la_SOURCES = \
53                 core/data.c include/core/data.h \
54                 core/time.c include/core/time.h \
55                 client/client.c include/client/sysdb.h \
56                 client/sock.c include/client/sock.h \
57                 utils/error.c include/utils/error.h \
58                 utils/proto.c include/utils/proto.h \
59                 utils/ssl.c include/utils/ssl.h \
60                 utils/strbuf.c include/utils/strbuf.h
61 libsysdbclient_la_CFLAGS = $(AM_CFLAGS) @OPENSSL_CFLAGS@
62 libsysdbclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
63 libsysdbclient_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 \
64                 -pthread -lm -lrt
65 libsysdbclient_la_LIBADD = $(LIBLTDL) @OPENSSL_LIBS@
67 # don't use strict CFLAGS for flex code
68 noinst_LTLIBRARIES += libsysdb_fe_parser.la
69 libsysdb_fe_parser_la_SOURCES = \
70                 parser/grammar.y parser/scanner.l
71 libsysdb_fe_parser_la_CFLAGS = @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@ \
72                 -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
73 libsysdb_la_SOURCES = \
74                 sysdb.c include/sysdb.h \
75                 core/object.c include/core/object.h \
76                 core/plugin.c include/core/plugin.h \
77                 core/store.c include/core/store.h \
78                 core/store-private.h \
79                 core/store_exec.c \
80                 core/store_expr.c \
81                 core/store_json.c \
82                 core/store_lookup.c \
83                 core/store_query.c \
84                 core/data.c include/core/data.h \
85                 core/time.c include/core/time.h \
86                 core/timeseries.c include/core/timeseries.h \
87                 frontend/connection.c include/frontend/connection.h \
88                 frontend/connection-private.h \
89                 frontend/sock.c include/frontend/sock.h \
90                 frontend/session.c \
91                 frontend/query.c \
92                 parser/analyzer.c \
93                 parser/ast.c include/parser/ast.h \
94                 parser/parser.c include/parser/parser.h \
95                 utils/avltree.c include/utils/avltree.h \
96                 utils/channel.c include/utils/channel.h \
97                 utils/error.c include/utils/error.h \
98                 utils/llist.c include/utils/llist.h \
99                 utils/os.c include/utils/os.h \
100                 utils/proto.c include/utils/proto.h \
101                 utils/ssl.c include/utils/ssl.h \
102                 utils/strbuf.c include/utils/strbuf.h \
103                 utils/unixsock.c include/utils/unixsock.h
104 libsysdb_la_CFLAGS = $(AM_CFLAGS) @OPENSSL_CFLAGS@
105 libsysdb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
106 libsysdb_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 \
107                 -pthread -lm -lrt
108 libsysdb_la_LIBADD = libsysdb_fe_parser.la \
109                 $(LIBLTDL) liboconfig/liboconfig.la @OPENSSL_LIBS@
110 libsysdb_la_DEPENDENCIES = libsysdb_fe_parser.la liboconfig/liboconfig.la
112 if BUILD_WITH_LIBDBI
113 libsysdb_la_SOURCES += \
114                 utils/dbi.c include/utils/dbi.h
115 libsysdb_la_LIBADD += -ldbi
116 endif
118 bin_PROGRAMS = sysdbd
119 if BUILD_CLIENT
120 bin_PROGRAMS += sysdb
122 # don't use strict CFLAGS for flex code
123 noinst_LTLIBRARIES += libsysdb_scanner.la
124 libsysdb_scanner_la_SOURCES = tools/sysdb/scanner.l
125 libsysdb_scanner_la_CFLAGS = @COVERAGE_CFLAGS@ @PROFILING_CFLAGS@ \
126                 -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
127 sysdb_SOURCES = tools/sysdb/main.c include/client/sysdb.h \
128                 tools/sysdb/command.c tools/sysdb/command.h \
129                 tools/sysdb/input.c tools/sysdb/input.h \
130                 core/object.c include/core/object.h \
131                 utils/llist.c include/utils/llist.h \
132                 utils/os.c include/utils/os.h
133 sysdb_CFLAGS = -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\"" \
134                 $(AM_CFLAGS) @READLINE_CFLAGS@
135 sysdb_LDADD = libsysdb_scanner.la libsysdbclient.la @READLINE_LIBS@ -lm
136 endif
138 sysdbd_SOURCES = tools/sysdbd/main.c include/sysdb.h \
139                 tools/sysdbd/configfile.c tools/sysdbd/configfile.h \
140                 $(libsysdb_la_SOURCES)
141 sysdbd_CFLAGS = $(AM_CFLAGS) @OPENSSL_CFLAGS@ \
142                 -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
143 sysdbd_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
144 sysdbd_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -pthread -lm
145 sysdbd_LDADD = libsysdb_fe_parser.la liboconfig/liboconfig.la \
146                 $(LIBLTDL) -lrt @OPENSSL_LIBS@
147 sysdbd_DEPENDENCIES = libsysdb_fe_parser.la liboconfig/liboconfig.la
149 if BUILD_WITH_LIBDBI
150 sysdbd_LDADD += -ldbi
151 endif
153 sdbconfdir = $(sysconfdir)/sysdb
154 dist_sdbconf_DATA = tools/sysdbd/sysdbd.conf.sample
156 pkgbackendlibdir = $(pkglibdir)/backend
157 pkgbackendcollectdlibdir = $(pkgbackendlibdir)/collectd
158 pkgbackendpuppetlibdir = $(pkgbackendlibdir)/puppet
159 pkgcnamelibdir = $(pkglibdir)/cname
160 pkgtimeserieslibdir = $(pkglibdir)/timeseries
161 pkgstorelibdir = $(pkglibdir)/store
163 pkglib_LTLIBRARIES =
164 pkgbackendlib_LTLIBRARIES =
165 pkgbackendcollectdlib_LTLIBRARIES =
166 pkgbackendpuppetlib_LTLIBRARIES =
167 pkgcnamelib_LTLIBRARIES =
168 pkgtimeserieslib_LTLIBRARIES =
169 pkgstorelib_LTLIBRARIES =
171 if BUILD_PLUGIN_CNAMEDNS
172 pkgcnamelib_LTLIBRARIES += plugins/cname/dns.la
173 plugins_cname_dns_la_SOURCE = plugins/cname/dns.c
174 plugins_cname_dns_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
175 sysdbd_LDADD += -dlopen plugins/cname/dns.la
176 sysdbd_DEPENDENCIES += plugins/cname/dns.la
177 endif
179 if BUILD_PLUGIN_COLLECTDUNIXSOCK
180 pkgbackendcollectdlib_LTLIBRARIES += plugins/backend/collectd/unixsock.la
181 plugins_backend_collectd_unixsock_la_SOURCES = plugins/backend/collectd/unixsock.c
182 plugins_backend_collectd_unixsock_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
183 sysdbd_LDADD += -dlopen plugins/backend/collectd/unixsock.la
184 sysdbd_DEPENDENCIES += plugins/backend/collectd/unixsock.la
185 endif
187 if BUILD_PLUGIN_FACTER
188 pkgbackendlib_LTLIBRARIES += plugins/backend/facter.la
189 plugins_backend_facter_la_SOURCES = plugins/backend/facter.cc
190 plugins_backend_facter_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -lfacter
191 sysdbd_LDADD += -dlopen plugins/backend/facter.la
192 sysdbd_DEPENDENCIES += plugins/backend/facter.la
193 endif
195 if BUILD_PLUGIN_MKLIVESTATUS
196 pkgbackendlib_LTLIBRARIES += plugins/backend/mk-livestatus.la
197 plugins_backend_mk_livestatus_la_SOURCES = plugins/backend/mk-livestatus.c
198 plugins_backend_mk_livestatus_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
199 sysdbd_LDADD += -dlopen plugins/backend/mk-livestatus.la
200 sysdbd_DEPENDENCIES += plugins/backend/mk-livestatus.la
201 endif
203 if BUILD_PLUGIN_PUPPETSTORECONFIGS
204 pkgbackendpuppetlib_LTLIBRARIES += plugins/backend/puppet/store-configs.la
205 plugins_backend_puppet_store_configs_la_SOURCES = plugins/backend/puppet/store-configs.c
206 plugins_backend_puppet_store_configs_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
207 sysdbd_LDADD += -dlopen plugins/backend/puppet/store-configs.la
208 sysdbd_DEPENDENCIES += plugins/backend/puppet/store-configs.la
209 endif
211 if BUILD_PLUGIN_SYSLOG
212 pkglib_LTLIBRARIES += plugins/syslog.la
213 plugins_syslog_la_SOURCE = plugins/syslog.c
214 plugins_syslog_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
215 sysdbd_LDADD += -dlopen plugins/syslog.la
216 sysdbd_DEPENDENCIES += plugins/syslog.la
217 endif
219 if BUILD_PLUGIN_TIMESERIESRRDTOOL
220 pkgtimeserieslib_LTLIBRARIES += plugins/timeseries/rrdtool.la
221 plugins_timeseries_rrdtool_la_SOURCES = plugins/timeseries/rrdtool.c
222 plugins_timeseries_rrdtool_la_CFLAGS = $(AM_CFLAGS) @RRD_CFLAGS@
223 plugins_timeseries_rrdtool_la_LDFLAGS = $(AM_LDFLAGS) @RRD_LIBS@ -module -avoid-version
224 sysdbd_LDADD += -dlopen plugins/timeseries/rrdtool.la
225 sysdbd_DEPENDENCIES += plugins/timeseries/rrdtool.la
226 endif
228 if BUILD_PLUGIN_STOREMEMORY
229 pkgstorelib_LTLIBRARIES += plugins/store/memory.la
230 plugins_store_memory_la_SOURCES = plugins/store/memory.c
231 plugins_store_memory_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
232 sysdbd_LDADD += -dlopen plugins/store/memory.la
233 sysdbd_DEPENDENCIES += plugins/store/memory.la
234 endif
236 if BUILD_PLUGIN_STORENETWORK
237 pkgstorelib_LTLIBRARIES += plugins/store/network.la
238 plugins_store_network_la_SOURCES = plugins/store/network.c
239 plugins_store_network_la_LDFLAGS = $(AM_LDFLAGS) libsysdbclient.la -module -avoid-version
240 sysdbd_LDADD += -dlopen plugins/store/network.la
241 sysdbd_DEPENDENCIES += plugins/store/network.la
242 endif
244 include/client/sysdb.h: include/client/sysdb.h.in $(abs_top_builddir)/version
245         mkdir -p include/client
246         source $(abs_top_builddir)/version; sed \
247             -e "s/@SDB_VERSION_MAJOR@/$$VERSION_MAJOR/g" \
248             -e "s/@SDB_VERSION_MINOR@/$$VERSION_MINOR/g" \
249             -e "s/@SDB_VERSION_PATCH@/$$VERSION_PATCH/g" \
250             -e "s/@SDB_VERSION_EXTRA@/$$VERSION_EXTRA/g" \
251             -e "s/@SDB_VERSION_STRING@/$$VERSION_STRING/g" \
252             $(srcdir)/include/client/sysdb.h.in \
253             > include/client/sysdb.h
255 include/sysdb.h: include/sysdb.h.in $(abs_top_builddir)/version
256         mkdir -p include
257         source $(abs_top_builddir)/version; sed \
258             -e "s/@SDB_VERSION_MAJOR@/$$VERSION_MAJOR/g" \
259             -e "s/@SDB_VERSION_MINOR@/$$VERSION_MINOR/g" \
260             -e "s/@SDB_VERSION_PATCH@/$$VERSION_PATCH/g" \
261             -e "s/@SDB_VERSION_EXTRA@/$$VERSION_EXTRA/g" \
262             -e "s/@SDB_VERSION_STRING@/$$VERSION_STRING/g" \
263             $(srcdir)/include/sysdb.h.in \
264             > include/sysdb.h
266 $(abs_top_builddir)/version:
267         cd .. && make version