libsecret: Don't use non-portable sed -i shell command
[platform/upstream/libsecret.git] / libsecret / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 SUBDIRS = . tests
4
5 AM_CPPFLAGS = \
6         -I$(top_srcdir) \
7         -DSECRET_COMPILATION \
8         $(NULL)
9
10 lib_LTLIBRARIES = libsecret-@SECRET_MAJOR@.la
11
12
13 incdir = $(includedir)/libsecret-@SECRET_MAJOR@/libsecret
14
15 HEADER_FILES = \
16         secret.h \
17         secret-attributes.h \
18         secret-collection.h \
19         secret-item.h \
20         secret-password.h \
21         secret-paths.h \
22         secret-prompt.h \
23         secret-schema.h \
24         secret-schemas.h \
25         secret-service.h \
26         secret-types.h \
27         secret-value.h \
28         $(NULL)
29
30 inc_HEADERS = \
31         $(HEADER_FILES) \
32         secret-enum-types.h \
33         $(NULL)
34
35 BUILT_SOURCES = \
36         secret-dbus-generated.c secret-dbus-generated.h \
37         secret-enum-types.c secret-enum-types.h \
38         $(NULL)
39
40 STABLE_FILES = \
41         secret-attributes.h secret-attributes.c \
42         secret-password.h secret-password.c \
43         secret-schema.h secret-schema.c \
44         secret-schemas.h secret-schemas.c \
45         secret-types.h \
46         $(NULL)
47
48 UNSTABLE_FILES = \
49         secret-collection.h secret-collection.c \
50         secret-item.h secret-item.c \
51         secret-methods.c \
52         secret-paths.h secret-paths.c \
53         secret-prompt.h secret-prompt.c \
54         secret-service.h secret-service.c \
55         secret-value.h secret-value.c \
56         $(NULL)
57
58 PRIVATE_FILES = \
59         secret-private.h \
60         secret-session.c \
61         secret-util.c \
62         $(NULL)
63
64 libsecret_@SECRET_MAJOR@_la_SOURCES = \
65         $(STABLE_FILES) \
66         $(UNSTABLE_FILES) \
67         $(PRIVATE_FILES) \
68         $(BUILT_SOURCES) \
69         $(NULL)
70
71 libsecret_@SECRET_MAJOR@_la_CFLAGS = \
72         $(LIBGCRYPT_CFLAGS)
73
74 libsecret_@SECRET_MAJOR@_la_LDFLAGS = \
75         -version-info $(SECRET_LT_RELEASE) \
76         -no-undefined \
77         -export-symbols-regex '^secret_|^SECRET_|^SECMEM_.*'
78
79 libsecret_@SECRET_MAJOR@_la_LIBADD = \
80         $(top_builddir)/egg/libegg.la \
81         $(LIBGCRYPT_LIBS) \
82         $(LIBS)
83
84 noinst_LTLIBRARIES = libsecret-testable.la
85 libsecret_testable_la_SOURCES =
86 libsecret_testable_la_LIBADD = $(libsecret_@SECRET_MAJOR@_la_OBJECTS) \
87         $(libsecret_@SECRET_MAJOR@_la_LIBADD)
88 libsecret_testable_la_DEPENDENCIES = $(libsecret_@SECRET_MAJOR@_la_OBJECTS)
89 libsecret_testable_la_LDFLAGS = -rpath /force/shared
90
91 DBUS_XML_DEFINITIONS = \
92         $(srcdir)/org.freedesktop.Secrets.xml
93
94 temp-dbus-generated.c: $(DBUS_XML_DEFINITIONS) Makefile.am
95         $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.Secret. \
96                 --generate-c-code temp-dbus-generated --c-namespace SecretGen \
97                 $(DBUS_XML_DEFINITIONS)
98 secret-dbus-generated.c: temp-dbus-generated.c Makefile.am
99         $(AM_V_GEN) sed -e '1i #define GLIB_DISABLE_DEPRECATION_WARNINGS' \
100                 -e 's/secret_gen_/_secret_gen_/g' -e 's/type-/type/g' \
101                 -e 's/temp-dbus-generated.h/secret-dbus-generated.h/g' \
102                 temp-dbus-generated.c > secret-dbus-generated.c
103 secret-dbus-generated.h: temp-dbus-generated.c Makefile.am
104         $(AM_V_GEN) sed -e 's/secret_gen_/_secret_gen_/g' -e 's/type-/type/g' \
105                 temp-dbus-generated.h > secret-dbus-generated.h
106
107 secret-enum-types.h: secret-enum-types.h.template $(HEADER_FILES)
108         $(AM_V_GEN) $(GLIB_MKENUMS) --template $^ > $@
109
110 secret-enum-types.c: secret-enum-types.c.template $(HEADER_FILES)
111         $(AM_V_GEN) $(GLIB_MKENUMS) --template $^ > $@
112
113 CLEANFILES =
114
115 # ------------------------------------------------------------------
116 # INTROSPECTION
117
118 if HAVE_INTROSPECTION
119
120 include $(INTROSPECTION_MAKEFILE)
121
122 INTROSPECTION_GIRS = Secret-@SECRET_MAJOR@.gir SecretUnstable-0.gir
123 INTROSPECTION_SCANNER_ARGS = $(INTROSPECTION_FLAGS) --warn-all --add-include-path=$(srcdir) --add-include-path=.
124 INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=.
125
126 Secret-@SECRET_MAJOR@.gir: libsecret-@SECRET_MAJOR@.la
127
128 Secret_@SECRET_MAJOR@_gir_NAMESPACE = Secret
129 Secret_@SECRET_MAJOR@_gir_EXPORT_PACKAGES = libsecret-@SECRET_MAJOR@
130 Secret_@SECRET_MAJOR@_gir_INCLUDES = GObject-2.0 Gio-2.0
131 Secret_@SECRET_MAJOR@_gir_LIBS = libsecret-@SECRET_MAJOR@.la
132 Secret_@SECRET_MAJOR@_gir_CFLAGS = -I$(top_srcdir) -I$(top_builddir) -DSECRET_COMPILATION
133 Secret_@SECRET_MAJOR@_gir_FILES = $(STABLE_FILES)
134 Secret_@SECRET_MAJOR@_gir_SCANNERFLAGS = --c-include "libsecret/secret.h"
135
136 SecretUnstable-0.gir: Secret-@SECRET_MAJOR@.gir
137
138 SecretUnstable_0_gir_NAMESPACE = SecretUnstable
139 SecretUnstable_0_gir_EXPORT_PACKAGES = libsecret-unstable
140 SecretUnstable_0_gir_INCLUDES = GObject-2.0 Gio-2.0
141 SecretUnstable_0_gir_LIBS = libsecret-@SECRET_MAJOR@.la
142 SecretUnstable_0_gir_CFLAGS = -I$(top_srcdir) -I$(top_builddir) -DSECRET_COMPILATION -DSECRET_API_SUBJECT_TO_CHANGE
143 SecretUnstable_0_gir_FILES = $(UNSTABLE_FILES)
144 SecretUnstable_0_gir_SCANNERFLAGS = --c-include "libsecret/secret.h" --identifier-prefix=Secret --symbol-prefix=secret --include-uninstalled=$(builddir)/Secret-@SECRET_MAJOR@.gir
145
146 girdir = $(datadir)/gir-1.0
147 gir_DATA = $(INTROSPECTION_GIRS)
148
149 typelibsdir = $(libdir)/girepository-1.0
150 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
151
152 if ENABLE_VAPIGEN
153 include $(VAPIGEN_MAKEFILE)
154
155 libsecret-@SECRET_MAJOR@.vapi: Secret-@SECRET_MAJOR@.gir Secret-@SECRET_MAJOR@.metadata libsecret-@SECRET_MAJOR@.deps
156
157 libsecret-unstable.vapi: SecretUnstable-0.gir SecretUnstable-0.metadata libsecret-unstable.deps
158
159 VAPIGEN_VAPIS = \
160         libsecret-@SECRET_MAJOR@.vapi \
161         libsecret-unstable.vapi
162
163 libsecret_@SECRET_MAJOR@_vapi_DEPS = glib-2.0 gio-2.0
164 libsecret_@SECRET_MAJOR@_vapi_METADATADIRS = $(srcdir)
165 libsecret_@SECRET_MAJOR@_vapi_FILES = Secret-@SECRET_MAJOR@.gir
166
167 libsecret_unstable_vapi_DEPS = gio-2.0 libsecret-@SECRET_MAJOR@
168 libsecret_unstable_vapi_METADATADIRS = $(srcdir)
169 libsecret_unstable_vapi_VAPIDIRS = $(builddir)
170 libsecret_unstable_vapi_GIRDIRS = $(builddir)
171 # ... because _GIRDIRS above is broken, yes, this is ugly
172 libsecret_unstable_vapi_FILES = --girdir=$(builddir)
173 libsecret_unstable_vapi_FILES += SecretUnstable-0.gir
174
175 VAPI_DEPS = $(VAPIGEN_VAPIS:.vapi=.deps)
176
177 libsecret-$(SECRET_MAJOR).deps: Makefile.am
178         $(AM_V_GEN) echo $(libsecret_@SECRET_MAJOR@_vapi_DEPS) | tr ' ' '\n' > $@
179 libsecret-unstable.deps: Makefile.am
180         $(AM_V_GEN) echo $(libsecret_unstable_vapi_DEPS) | tr ' ' '\n' > $@
181
182 vapidir = $(datadir)/vala/vapi
183 vapi_DATA = \
184         $(VAPIGEN_VAPIS) \
185         $(VAPI_DEPS)
186
187 CLEANFILES += \
188         $(VAPIGEN_VAPIS) \
189         $(VAPI_DEPS)
190
191 endif # ENABLE_VAPIGEN
192 endif # HAVE_INTROSPECTION
193
194 # ------------------------------------------------------------------
195 # PKG CONFIG
196
197 libsecret-$(SECRET_MAJOR).pc: libsecret.pc
198         cp libsecret.pc libsecret-$(SECRET_MAJOR).pc
199
200 pkgconfigdir = $(libdir)/pkgconfig
201 pkgconfig_DATA = \
202         libsecret-$(SECRET_MAJOR).pc \
203         libsecret-unstable.pc
204
205 # ------------------------------------------------------------------
206
207
208 EXTRA_DIST = \
209         secret-enum-types.h.template \
210         secret-enum-types.c.template \
211         org.freedesktop.Secrets.xml \
212         Secret-@SECRET_MAJOR@.metadata \
213         SecretUnstable-0.metadata \
214         $(NULL)
215
216 CLEANFILES += \
217         $(pkgconfig_DATA) \
218         $(gir_DATA) \
219         $(typelibs_DATA) \
220         temp-dbus-generated.c \
221         temp-dbus-generated.h \
222         $(NULL)
223
224 DISTCLEANFILES = \
225         secret-dbus-generated.c \
226         secret-dbus-generated.h \
227         $(NULL)
228
229 check-memory:
230         make -C tests check-memory