Makefile.am: Get the dependencies of libsecret-testable.so right
[platform/upstream/libsecret.git] / libsecret / Makefile.am
1
2 lib_LTLIBRARIES += libsecret-@SECRET_MAJOR@.la
3
4
5 incdir = $(includedir)/libsecret-@SECRET_MAJOR@/libsecret
6
7 libsecret_HEADS = \
8         libsecret/secret.h \
9         libsecret/secret-attributes.h \
10         libsecret/secret-collection.h \
11         libsecret/secret-item.h \
12         libsecret/secret-password.h \
13         libsecret/secret-paths.h \
14         libsecret/secret-prompt.h \
15         libsecret/secret-schema.h \
16         libsecret/secret-schemas.h \
17         libsecret/secret-service.h \
18         libsecret/secret-types.h \
19         libsecret/secret-value.h \
20         $(NULL)
21
22 inc_HEADERS = \
23         $(libsecret_HEADS) \
24         libsecret/secret-enum-types.h \
25         $(NULL)
26
27 libsecret_BUILT = \
28         secret-dbus-generated.c secret-dbus-generated.h \
29         libsecret/secret-enum-types.c libsecret/secret-enum-types.h \
30         $(NULL)
31
32 libsecret_PUBLIC = \
33         libsecret/secret-attributes.h libsecret/secret-attributes.c \
34         libsecret/secret-collection.h libsecret/secret-collection.c \
35         libsecret/secret-item.h libsecret/secret-item.c \
36         libsecret/secret-methods.c \
37         libsecret/secret-password.h libsecret/secret-password.c \
38         libsecret/secret-prompt.h libsecret/secret-prompt.c \
39         libsecret/secret-schema.h libsecret/secret-schema.c \
40         libsecret/secret-schemas.h libsecret/secret-schemas.c \
41         libsecret/secret-service.h libsecret/secret-service.c \
42         libsecret/secret-types.h \
43         libsecret/secret-value.h libsecret/secret-value.c \
44         libsecret/secret-paths.h libsecret/secret-paths.c \
45         $(NULL)
46
47 libsecret_PRIVATE = \
48         libsecret/secret-private.h \
49         libsecret/secret-session.c \
50         libsecret/secret-util.c \
51         $(NULL)
52
53 libsecret_@SECRET_MAJOR@_la_SOURCES = \
54         $(libsecret_PUBLIC) \
55         $(libsecret_PRIVATE) \
56         $(libsecret_BUILT) \
57         $(NULL)
58
59 libsecret_@SECRET_MAJOR@_la_CFLAGS = \
60         -DSECRET_COMPILATION \
61         $(LIBGCRYPT_CFLAGS)
62
63 libsecret_@SECRET_MAJOR@_la_LDFLAGS = \
64         -version-info $(SECRET_LT_RELEASE) \
65         -no-undefined \
66         -export-symbols-regex '^secret_|^SECRET_|^SECMEM_.*'
67
68 libsecret_@SECRET_MAJOR@_la_LIBADD = \
69         libegg.la \
70         $(LIBGCRYPT_LIBS) \
71         $(LIBS)
72
73 BUILT_SOURCES += $(libsecret_BUILT)
74
75 noinst_LTLIBRARIES += libsecret-testable.la
76 libsecret_testable_la_SOURCES =
77 libsecret_testable_la_LIBADD = \
78         $(libsecret_@SECRET_MAJOR@_la_OBJECTS) \
79         $(libsecret_@SECRET_MAJOR@_la_LIBADD)
80 libsecret_testable_la_DEPENDENCIES = \
81         $(libsecret_@SECRET_MAJOR@_la_OBJECTS) \
82         $(libsecret_@SECRET_MAJOR@_la_DEPENDENCIES)
83 libsecret_testable_la_LDFLAGS = -rpath /force/shared
84
85 DBUS_XML_DEFINITIONS = \
86         libsecret/org.freedesktop.Secrets.xml
87
88 temp-dbus-generated.c: $(DBUS_XML_DEFINITIONS) Makefile.am
89         $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.Secret. \
90                 --generate-c-code temp-dbus-generated --c-namespace SecretGen $<
91 secret-dbus-generated.c: temp-dbus-generated.c Makefile.am
92         $(AM_V_GEN) sed -e '1i\
93         #define GLIB_DISABLE_DEPRECATION_WARNINGS' \
94                 -e 's/secret_gen_/_secret_gen_/g' -e 's/type-/type/g' \
95                 -e 's/temp-dbus-generated.h/secret-dbus-generated.h/g' \
96                 temp-dbus-generated.c > secret-dbus-generated.c
97 secret-dbus-generated.h: temp-dbus-generated.c Makefile.am
98         $(AM_V_GEN) sed -e 's/secret_gen_/_secret_gen_/g' -e 's/type-/type/g' \
99                 temp-dbus-generated.h > secret-dbus-generated.h
100
101 libsecret/secret-enum-types.h: libsecret/secret-enum-types.h.template $(libsecret_HEADS)
102         $(AM_V_GEN) $(GLIB_MKENUMS) --template $^ > $@
103
104 libsecret/secret-enum-types.c: libsecret/secret-enum-types.c.template $(libsecret_HEADS)
105         $(AM_V_GEN) $(GLIB_MKENUMS) --template $^ > $@
106
107 # ------------------------------------------------------------------
108 # INTROSPECTION
109
110 if HAVE_INTROSPECTION
111
112 INTROSPECTION_GIRS += Secret-@SECRET_MAJOR@.gir
113
114 Secret-@SECRET_MAJOR@.gir: libsecret-@SECRET_MAJOR@.la
115
116 Secret_@SECRET_MAJOR@_gir_NAMESPACE = Secret
117 Secret_@SECRET_MAJOR@_gir_EXPORT_PACKAGES = libsecret-@SECRET_MAJOR@
118 Secret_@SECRET_MAJOR@_gir_INCLUDES = GObject-2.0 Gio-2.0
119 Secret_@SECRET_MAJOR@_gir_LIBS = libsecret-@SECRET_MAJOR@.la
120 Secret_@SECRET_MAJOR@_gir_CFLAGS = -I$(srcdir) -I$(builddir) -DSECRET_COMPILATION
121 Secret_@SECRET_MAJOR@_gir_FILES = $(libsecret_PUBLIC)
122 Secret_@SECRET_MAJOR@_gir_SCANNERFLAGS = --c-include "libsecret/secret.h"
123
124 gir_DATA += Secret-@SECRET_MAJOR@.gir
125
126 if ENABLE_VAPIGEN
127
128 libsecret-@SECRET_MAJOR@.vapi: Secret-@SECRET_MAJOR@.gir libsecret/Secret-@SECRET_MAJOR@.metadata libsecret-@SECRET_MAJOR@.deps
129
130 VAPIGEN_VAPIS += libsecret-@SECRET_MAJOR@.vapi
131
132 libsecret_@SECRET_MAJOR@_vapi_DEPS = glib-2.0 gio-2.0
133 libsecret_@SECRET_MAJOR@_vapi_METADATADIRS = $(srcdir)/libsecret
134 libsecret_@SECRET_MAJOR@_vapi_FILES = Secret-@SECRET_MAJOR@.gir
135
136 libsecret-$(SECRET_MAJOR).deps: Makefile.am
137         $(AM_V_GEN) echo $(libsecret_@SECRET_MAJOR@_vapi_DEPS) | tr ' ' '\n' > $@
138
139 vapi_DATA += \
140         libsecret-@SECRET_MAJOR@.vapi \
141         libsecret-@SECRET_MAJOR@.deps
142         
143 endif # ENABLE_VAPIGEN
144 endif # HAVE_INTROSPECTION
145
146 # ------------------------------------------------------------------
147 # PKG CONFIG
148
149 libsecret-$(SECRET_MAJOR).pc: libsecret/libsecret.pc
150         $(AM_V_GEN) cp libsecret/libsecret.pc libsecret-$(SECRET_MAJOR).pc
151
152 pkgconfig_DATA += \
153         libsecret-$(SECRET_MAJOR).pc \
154         libsecret/libsecret-unstable.pc
155
156 EXTRA_DIST += \
157         libsecret/secret-enum-types.h.template \
158         libsecret/secret-enum-types.c.template \
159         libsecret/org.freedesktop.Secrets.xml \
160         libsecret/Secret-@SECRET_MAJOR@.metadata \
161         $(NULL)
162
163 CLEANFILES += \
164         temp-dbus-generated.c \
165         temp-dbus-generated.h \
166         $(NULL)
167
168 DISTCLEANFILES += \
169         secret-dbus-generated.c \
170         secret-dbus-generated.h \
171         $(NULL)
172
173 # ------------------------------------------------------------------
174 # TESTS
175
176 noinst_LTLIBRARIES += libmock_service.la
177
178 libmock_service_la_SOURCES = \
179         libsecret/mock-service.c \
180         libsecret/mock-service.h \
181         $(NULL)
182
183 libmock_service_la_LDFLAGS = \
184         -rpath /force/shared
185
186 libmock_service_la_LIBADD = \
187         $(LIBGCRYPT_LIBS)
188
189 libsecret_LIBS = \
190         libsecret-testable.la \
191         libmock_service.la \
192         $(NULL)
193
194 C_TESTS = \
195         test-attributes \
196         test-value \
197         test-prompt \
198         test-service \
199         test-session \
200         test-paths \
201         test-methods \
202         test-password \
203         test-item \
204         test-collection \
205         $(NULL)
206
207 test_attributes_SOURCES = libsecret/test-attributes.c
208 test_attributes_LDADD = $(libsecret_LIBS)
209
210 test_collection_SOURCES = libsecret/test-collection.c
211 test_collection_LDADD = $(libsecret_LIBS)
212
213 test_item_SOURCES = libsecret/test-item.c
214 test_item_LDADD = $(libsecret_LIBS)
215
216 test_methods_SOURCES = libsecret/test-methods.c
217 test_methods_LDADD = $(libsecret_LIBS)
218
219 test_password_SOURCES = libsecret/test-password.c
220 test_password_LDADD = $(libsecret_LIBS)
221
222 test_paths_SOURCES = libsecret/test-paths.c
223 test_paths_LDADD = $(libsecret_LIBS)
224
225 test_prompt_SOURCES = libsecret/test-prompt.c
226 test_prompt_LDADD = $(libsecret_LIBS)
227
228 test_service_SOURCES = libsecret/test-service.c
229 test_service_LDADD = $(libsecret_LIBS)
230
231 test_session_SOURCES = libsecret/test-session.c
232 test_session_LDADD = $(libsecret_LIBS)
233
234 test_value_SOURCES = libsecret/test-value.c
235 test_value_LDADD = $(libsecret_LIBS)
236
237 JS_TESTS = \
238         libsecret/test-js-lookup.js \
239         libsecret/test-js-clear.js \
240         libsecret/test-js-store.js \
241         $(NULL)
242
243 PY_TESTS = \
244         libsecret/test-py-lookup.py \
245         libsecret/test-py-clear.py \
246         libsecret/test-py-store.py \
247         $(NULL)
248
249 check_PROGRAMS += $(C_TESTS)
250 TESTS += $(C_TESTS) $(PY_TESTS) $(JS_TESTS)
251
252 # ------------------------------------------------------------------
253 # VALA TESTS
254
255 if HAVE_VALAC
256
257 VALA_V = $(VALA_V_$(V))
258 VALA_V_ = $(VALA_V_$(AM_DEFAULT_VERBOSITY))
259 VALA_V_0 = @echo "  VALAC   " $@;
260
261 VALA_TESTS_FLAGS = \
262         --Xcc=-w \
263         --Xcc=-I$(srcdir) \
264         --Xcc=-I$(srcdir)/libsecret \
265         --vapidir=$(builddir) \
266         --pkg libsecret-@SECRET_MAJOR@ \
267         --pkg mock-service-0 \
268         --pkg gio-2.0
269
270 VALA_TESTS_VAPIS = \
271         libsecret-@SECRET_MAJOR@.vapi \
272         mock-service-0.vapi
273
274 VALA_TESTS = \
275         test-vala-lang \
276         test-vala-unstable \
277         $(NULL)
278
279 SUFFIXES = .vala .vala.o
280
281 test-vala-lang.vala.o: libsecret/test-vala-lang.vala
282         $(VALA_V) $(VALAC) --compile $(VALA_TESTS_FLAGS) $<
283 test-vala-unstable.vala.o: libsecret/test-vala-unstable.vala
284         $(VALA_V) $(VALAC) --compile $(VALA_TESTS_FLAGS) $<
285
286 test_vala_lang_SOURCES =
287 test_vala_lang_LDADD = \
288         test-vala-lang.vala.o \
289         libsecret-@SECRET_MAJOR@.la \
290         libmock_service.la
291
292 test_vala_unstable_SOURCES =
293 test_vala_unstable_LDADD = \
294         test-vala-unstable.vala.o \
295         libsecret-@SECRET_MAJOR@.la \
296         libmock_service.la
297
298 if HAVE_INTROSPECTION
299 if ENABLE_VAPIGEN
300
301 check_PROGRAMS += $(VALA_TESTS)
302 TESTS += $(VALA_TESTS)
303
304 endif # ENABLE_VAPIGEN
305 endif # HAVE_INTROSPECTION
306
307 endif # HAVE_VALAC
308
309 # ------------------------------------------------------------------
310 # TEST INTROSPECTION
311
312 if HAVE_INTROSPECTION
313
314 INTROSPECTION_GIRS += MockService-0.gir
315
316 MockService-0.gir: libmock_service.la
317
318 MockService_0_gir_PACKAGES = gobject-2.0 gio-2.0
319 MockService_0_gir_EXPORT_PACKAGES = mock-service-0
320 MockService_0_gir_INCLUDES = GObject-2.0 Gio-2.0
321 MockService_0_gir_LIBS = libmock_service.la
322 MockService_0_gir_CFLAGS = -I$(builddir) -I$(srcdir)
323 MockService_0_gir_FILES = $(libmock_service_la_SOURCES)
324 MockService_0_gir_SCANNERFLAGS = --c-include "libsecret/mock-service.h"
325
326 noinst_DATA += MockService-0.gir MockService-0.typelib
327 CLEANFILES += MockService-0.gir MockService-0.typelib
328
329 if ENABLE_VAPIGEN
330
331 mock-service-0.vapi: MockService-0.gir libsecret-@SECRET_MAJOR@.vapi
332
333 mock-service-0.deps:
334
335 VAPIGEN_VAPIS += mock-service-0.vapi
336
337 mock_service_0_vapi_DEPS = gio-2.0 libsecret-@SECRET_MAJOR@
338 mock_service_0_vapi_METADATADIRS = $(builddir)
339 mock_service_0_vapi_VAPIDIRS = $(builddir)
340 mock_service_0_vapi_FILES = MockService-0.gir
341
342 noinst_DATA += mock-service-0.vapi
343
344 CLEANFILES += mock-service-0.vapi
345
346 endif # ENABLE_VAPIGEN
347 endif # HAVE_INTROSPECTION
348
349 #--------------------------------------------------------------------
350
351 EXTRA_DIST += \
352         libsecret/mock \
353         libsecret/mock-service-delete.py \
354         libsecret/mock-service-empty.py \
355         libsecret/mock-service-lock.py \
356         libsecret/mock-service-normal.py \
357         libsecret/mock-service-only-plain.py \
358         libsecret/mock-service-prompt.py \
359         $(JS_TESTS) \
360         $(PY_TESTS) \
361         $(NULL)