Code

store_lookup_test: Verify that NULL is not a valid attribute name.
[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@
5 AM_LDFLAGS = @COVERAGE_LDFLAGS@
6 AM_CPPFLAGS  = -I"${top_srcdir}/src/include"
7 AM_CPPFLAGS += -DSYSCONFDIR='"${sysconfdir}"'
8 AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
9 AM_CPPFLAGS += -DPKGLIBDIR='"${pkglibdir}"'
11 AM_YFLAGS = -d
13 BUILT_SOURCES = include/client/sysdb.h include/sysdb.h \
14                 frontend/grammar.h
15 EXTRA_DIST = include/client/sysdb.h.in include/sysdb.h.in
17 pkginclude_HEADERS = include/sysdb.h
18 pkgcoreincludedir = $(pkgincludedir)/core
19 pkgcoreinclude_HEADERS = \
20                 include/core/data.h \
21                 include/core/object.h \
22                 include/core/plugin.h \
23                 include/core/store.h \
24                 include/core/time.h
25 pkgfeincludedir = $(pkgincludedir)/frontend
26 pkgfeinclude_HEADERS = \
27                 include/frontend/connection.h \
28                 include/frontend/parser.h \
29                 include/frontend/proto.h \
30                 include/frontend/sock.h
31 pkgutilsincludedir = $(pkgincludedir)/utils
32 pkgutilsinclude_HEADERS = \
33                 include/utils/channel.h \
34                 include/utils/dbi.h \
35                 include/utils/error.h \
36                 include/utils/llist.h \
37                 include/utils/proto.h \
38                 include/utils/strbuf.h \
39                 include/utils/unixsock.h
41 pkgclientincludedir = $(pkgincludedir)/client
42 pkgclientinclude_HEADERS = \
43                 include/client/sock.h \
44                 include/client/sysdb.h
46 noinst_LTLIBRARIES = libsysdbclient.la libsysdb.la
48 libsysdbclient_la_SOURCES = \
49                 client/client.c include/client/sysdb.h \
50                 client/sock.c include/client/sock.h \
51                 utils/error.c include/utils/error.h \
52                 utils/proto.c include/utils/proto.h \
53                 utils/strbuf.c include/utils/strbuf.h
54 libsysdbclient_la_CFLAGS = $(AM_CFLAGS)
55 libsysdbclient_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
56 libsysdbclient_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 -pthread
57 libsysdbclient_la_LIBADD = $(LIBLTDL)
59 # don't use strict CFLAGS for flex code
60 noinst_LTLIBRARIES += libsysdb_fe_parser.la
61 libsysdb_fe_parser_la_SOURCES = \
62                 frontend/grammar.y frontend/scanner.l
63 libsysdb_fe_parser_la_CFLAGS = -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
64 libsysdb_la_SOURCES = \
65                 sysdb.c include/sysdb.h \
66                 core/object.c include/core/object.h \
67                 core/plugin.c include/core/plugin.h \
68                 core/store.c include/core/store.h \
69                 core/store-private.h \
70                 core/store_lookup.c \
71                 core/data.c include/core/data.h \
72                 frontend/connection.c include/frontend/connection.h \
73                 frontend/connection-private.h \
74                 frontend/parser.c include/frontend/parser.h \
75                 frontend/sock.c include/frontend/sock.h \
76                 frontend/session.c \
77                 frontend/query.c \
78                 utils/channel.c include/utils/channel.h \
79                 utils/error.c include/utils/error.h \
80                 utils/llist.c include/utils/llist.h \
81                 utils/proto.c include/utils/proto.h \
82                 utils/strbuf.c include/utils/strbuf.h \
83                 core/time.c include/core/time.h \
84                 utils/unixsock.c include/utils/unixsock.h
85 libsysdb_la_CFLAGS = $(AM_CFLAGS)
86 libsysdb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
87 libsysdb_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 -pthread
88 libsysdb_la_LIBADD = libsysdb_fe_parser.la \
89                 $(LIBLTDL) -lrt liboconfig/liboconfig.la
90 libsysdb_la_DEPENDENCIES = libsysdb_fe_parser.la liboconfig/liboconfig.la
92 if BUILD_WITH_LIBDBI
93 libsysdb_la_SOURCES += \
94                 utils/dbi.c include/utils/dbi.h
95 libsysdb_la_LIBADD += -ldbi
96 endif
98 bin_PROGRAMS = sysdbd
99 if BUILD_CLIENT
100 bin_PROGRAMS += sysdb
102 # don't use strict CFLAGS for flex code
103 noinst_LTLIBRARIES += libsysdb_scanner.la
104 libsysdb_scanner_la_SOURCES = tools/sysdb/scanner.l
105 libsysdb_scanner_la_CFLAGS = -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
106 sysdb_SOURCES = tools/sysdb/main.c include/client/sysdb.h \
107                 tools/sysdb/command.c tools/sysdb/command.h \
108                 tools/sysdb/input.c tools/sysdb/input.h \
109                 core/object.c include/core/object.h \
110                 utils/llist.c include/utils/llist.h
111 sysdb_CFLAGS = -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\"" \
112                 $(AM_CFLAGS) @READLINE_CFLAGS@
113 sysdb_LDADD = libsysdb_scanner.la libsysdbclient.la @READLINE_LIBS@
114 endif
116 sysdbd_SOURCES = tools/sysdbd/main.c include/sysdb.h \
117                 tools/sysdbd/configfile.c tools/sysdbd/configfile.h
118 sysdbd_CFLAGS = $(AM_CFLAGS) -DBUILD_DATE="\"$$( date --utc '+%F %T' ) (UTC)\""
119 sysdbd_LDFLAGS = -export-dynamic
120 sysdbd_LDADD = libsysdb.la liboconfig/liboconfig.la
121 sysdbd_DEPENDENCIES = liboconfig/liboconfig.la
123 sdbconfdir = $(sysconfdir)/sysdb
124 dist_sdbconf_DATA = tools/sysdbd/sysdbd.conf.sample
126 pkgbackendlibdir = $(pkglibdir)/backend
127 pkgbackendcollectdlibdir = $(pkgbackendlibdir)/collectd
128 pkgbackendpuppetlibdir = $(pkgbackendlibdir)/puppet
129 pkgcnamelibdir = $(pkglibdir)/cname
131 pkglib_LTLIBRARIES =
132 pkgbackendlib_LTLIBRARIES =
133 pkgbackendcollectdlib_LTLIBRARIES =
134 pkgbackendpuppetlib_LTLIBRARIES =
135 pkgcnamelib_LTLIBRARIES =
137 if BUILD_PLUGIN_CNAMEDNS
138 pkgcnamelib_LTLIBRARIES += plugins/cname/dns.la
139 plugins_cname_dns_la_SOURCE = plugins/cname/dns.c
140 plugins_cname_dns_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
141 libsysdb_la_LIBADD += -dlopen plugins/cname/dns.la
142 libsysdb_la_DEPENDENCIES += plugins/cname/dns.la
143 endif
145 if BUILD_PLUGIN_COLLECTD
146 pkgbackendcollectdlib_LTLIBRARIES += backend/collectd/unixsock.la
147 backend_collectd_unixsock_la_SOURCES = backend/collectd/unixsock.c
148 backend_collectd_unixsock_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
149 libsysdb_la_LIBADD += -dlopen backend/collectd/unixsock.la
150 libsysdb_la_DEPENDENCIES += backend/collectd/unixsock.la
151 endif
153 if BUILD_PLUGIN_MKLIVESTATUS
154 pkgbackendlib_LTLIBRARIES += backend/mk-livestatus.la
155 backend_mk_livestatus_la_SOURCES = backend/mk-livestatus.c
156 backend_mk_livestatus_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
157 libsysdb_la_LIBADD += -dlopen backend/mk-livestatus.la
158 libsysdb_la_DEPENDENCIES += backend/mk-livestatus.la
159 endif
161 if BUILD_PLUGIN_PUPPETSTORECONFIGS
162 pkgbackendpuppetlib_LTLIBRARIES += backend/puppet/store-configs.la
163 backend_puppet_store_configs_la_SOURCES = backend/puppet/store-configs.c
164 backend_puppet_store_configs_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
165 libsysdb_la_LIBADD += -dlopen backend/puppet/store-configs.la
166 libsysdb_la_DEPENDENCIES += backend/puppet/store-configs.la
167 endif
169 if BUILD_PLUGIN_SYSLOG
170 pkglib_LTLIBRARIES += plugins/syslog.la
171 plugins_syslog_la_SOURCE = plugins/syslog.c
172 plugins_syslog_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
173 libsysdb_la_LIBADD += -dlopen plugins/syslog.la
174 libsysdb_la_DEPENDENCIES += plugins/syslog.la
175 endif
177 include/client/sysdb.h: include/client/sysdb.h.in ../version
178         source ../version; sed \
179             -e "s/@SDB_VERSION_MAJOR@/$$VERSION_MAJOR/g" \
180             -e "s/@SDB_VERSION_MINOR@/$$VERSION_MINOR/g" \
181             -e "s/@SDB_VERSION_PATCH@/$$VERSION_PATCH/g" \
182             -e "s/@SDB_VERSION_EXTRA@/$$VERSION_EXTRA/g" \
183             -e "s/@SDB_VERSION_STRING@/$$VERSION_STRING/g" \
184             include/client/sysdb.h.in > include/client/sysdb.h
186 include/sysdb.h: include/sysdb.h.in ../version
187         source ../version; sed \
188             -e "s/@SDB_VERSION_MAJOR@/$$VERSION_MAJOR/g" \
189             -e "s/@SDB_VERSION_MINOR@/$$VERSION_MINOR/g" \
190             -e "s/@SDB_VERSION_PATCH@/$$VERSION_PATCH/g" \
191             -e "s/@SDB_VERSION_EXTRA@/$$VERSION_EXTRA/g" \
192             -e "s/@SDB_VERSION_STRING@/$$VERSION_STRING/g" \
193             include/sysdb.h.in > include/sysdb.h
195 ../version:
196         cd .. && make version