Switch to using a shared library instead of static
[entangle:entangle.git] / src / Makefile.am
1
2 SUBDIRS = plugins
3
4 lib_LTLIBRARIES = libentangle_backend.la libentangle_frontend.la
5
6 bin_PROGRAMS = entangle
7
8 builderdir = $(pkgdatadir)
9 builder_DATA = \
10         frontend/entangle-camera-support.ui \
11         frontend/entangle-camera-manager.ui \
12         frontend/entangle-camera-picker.ui \
13         frontend/entangle-help-about.ui \
14         frontend/entangle-image-popup.ui \
15         frontend/entangle-preferences-display.ui
16
17 desktopdir = $(datadir)/applications
18 desktop_DATA_IN = entangle.desktop.in
19 desktop_DATA = entangle.desktop
20
21 appdatadir = $(datadir)/appdata
22 appdata_DATA_IN = entangle.appdata.xml.in
23 appdata_DATA = $(appdata_DATA_IN:.xml.in=.xml)
24
25 icon128x128dir = $(datadir)/icons/hicolor/128x128/apps
26 icon128x128_DATA = \
27         icons/128x128/entangle.png \
28         $(NULL)
29
30 icon192x192dir = $(datadir)/icons/hicolor/192x192/apps
31 icon192x192_DATA = \
32         icons/192x192/entangle.png \
33         $(NULL)
34
35 icon16x16dir = $(datadir)/icons/hicolor/16x16/apps
36 icon16x16_DATA = \
37         icons/16x16/entangle.png \
38         $(NULL)
39
40 icon22x22dir = $(datadir)/icons/hicolor/22x22/apps
41 icon22x22_DATA = \
42         icons/22x22/entangle-capture.png \
43         icons/22x22/entangle-color-management.png \
44         icons/22x22/entangle-imageviewer.png \
45         icons/22x22/entangle-interface.png \
46         icons/22x22/entangle-plugins.png \
47         $(NULL)
48
49 icon256x256dir = $(datadir)/icons/hicolor/256x256/apps
50 icon256x256_DATA = \
51         icons/256x256/entangle.png \
52         $(NULL)
53
54 icon32x32dir = $(datadir)/icons/hicolor/32x32/apps
55 icon32x32_DATA = \
56         icons/32x32/entangle.png \
57         $(NULL)
58
59 icon48x48dir = $(datadir)/icons/hicolor/48x48/apps
60 icon48x48_DATA = \
61         icons/48x48/entangle.png \
62         icons/48x48/entangle-capture.png \
63         icons/48x48/entangle-color-management.png \
64         icons/48x48/entangle-imageviewer.png \
65         icons/48x48/entangle-interface.png \
66         icons/48x48/entangle-plugins.png \
67         $(NULL)
68
69 icon64x64dir = $(datadir)/icons/hicolor/64x64/apps
70 icon64x64_DATA = \
71         icons/64x64/entangle.png \
72         $(NULL)
73
74 icon96x96dir = $(datadir)/icons/hicolor/96x96/apps
75 icon96x96_DATA = \
76         icons/96x96/entangle.png \
77         $(NULL)
78
79 iconscalabledir = $(datadir)/icons/hicolor/scalable/apps
80 iconscalable_DATA = \
81         icons/scalable/entangle.svg \
82         $(NULL)
83
84
85
86 gsettings_SCHEMAS = org.entangle-photo.manager.gschema.xml
87
88 @GSETTINGS_RULES@
89
90 iccdir = $(pkgdatadir)
91 icc_DATA = sRGB.icc
92
93 BUILT_SOURCES = \
94         $(desktop_DATA) \
95         $(appdata_DATA) \
96         $(NULL)
97
98 EXTRA_DIST = \
99         $(builder_DATA) \
100         $(desktop_DATA) \
101         $(desktop_DATA_IN) \
102         $(appdata_DATA) \
103         $(appdata_DATA_IN) \
104         $(icon128x128_DATA) \
105         $(icon192x192_DATA) \
106         $(icon16x16_DATA) \
107         $(icon22x22_DATA) \
108         $(icon256x256_DATA) \
109         $(icon32x32_DATA) \
110         $(icon48x48_DATA) \
111         $(icon64x64_DATA) \
112         $(icon96x96_DATA) \
113         $(iconscalable_DATA) \
114         $(icc_DATA) \
115         $(gsettings_SCHEMAS) \
116         $(NULL)
117
118 libentangle_backend_la_SOURCES = \
119         backend/entangle-camera.h backend/entangle-camera.c \
120         backend/entangle-camera-automata.h backend/entangle-camera-automata.c \
121         backend/entangle-camera-file.h backend/entangle-camera-file.c \
122         backend/entangle-camera-list.h backend/entangle-camera-list.c \
123         backend/entangle-colour-profile.h backend/entangle-colour-profile.c \
124         backend/entangle-control.h backend/entangle-control.c \
125         backend/entangle-control-button.h backend/entangle-control-button.c \
126         backend/entangle-control-choice.h backend/entangle-control-choice.c \
127         backend/entangle-control-date.h backend/entangle-control-date.c \
128         backend/entangle-control-group.h backend/entangle-control-group.c \
129         backend/entangle-control-range.h backend/entangle-control-range.c \
130         backend/entangle-control-text.h backend/entangle-control-text.c \
131         backend/entangle-control-toggle.h backend/entangle-control-toggle.c \
132         backend/entangle-debug.h backend/entangle-debug.c \
133         backend/entangle-device-manager.h backend/entangle-device-manager.c \
134         backend/entangle-image.h backend/entangle-image.c \
135         backend/entangle-pixbuf.h backend/entangle-pixbuf.c \
136         backend/entangle-image-loader.h backend/entangle-image-loader.c \
137         backend/entangle-pixbuf-loader.h backend/entangle-pixbuf-loader.c \
138         backend/entangle-progress.h backend/entangle-progress.c \
139         backend/entangle-session.h backend/entangle-session.c \
140         backend/entangle-thumbnail-loader.h backend/entangle-thumbnail-loader.c
141
142 nodist_libentangle_backend_la_SOURCES = \
143         backend/entangle-camera-enums.h backend/entangle-camera-enums.c \
144         backend/entangle-colour-profile-enums.h backend/entangle-colour-profile-enums.c \
145         $(NULL)
146
147 BUILT_SOURCES += $(nodist_libentangle_backend_la_SOURCES)
148
149 libentangle_backend_la_LDFLAGS = \
150         $(GLIB_LIBS) \
151         $(GIO_LIBS) \
152         $(GTHREAD_LIBS) \
153         $(GDK_PIXBUF_LIBS) \
154         $(GPHOTO2_LIBS) \
155         $(LCMS2_LIBS) \
156         $(GUDEV_LIBS) \
157         $(DBUS_GLIB_LIBS) \
158         $(LIBPEAS_LIBS) \
159         $(GEXIV2_LIBS) \
160         $(LIBRAW_LIBS) \
161         $(NULL)
162
163 libentangle_backend_la_CFLAGS = \
164         -I$(builddir)/backend \
165         $(GLIB_CFLAGS) \
166         $(GIO_CFLAGS) \
167         $(GMODULE_CFLAGS) \
168         $(GTHREAD_CFLAGS) \
169         $(GDK_PIXBUF_CFLAGS) \
170         $(GPHOTO2_CFLAGS) \
171         $(LCMS2_CFLAGS) \
172         $(GUDEV_CFLAGS) \
173         $(DBUS_GLIB_CFLAGS) \
174         $(LIBPEAS_CFLAGS) \
175         $(GEXIV2_CFLAGS) \
176         $(LIBRAW_CFLAGS) \
177         $(WARN_CFLAGS) \
178         -DPKGDATADIR="\"$(pkgdatadir)\"" \
179         -DDATADIR="\"$(datadir)\"" \
180         -DLIBDIR="\"$(libdir)\"" \
181         -DG_LOG_DOMAIN="\"$(PACKAGE)\"" \
182         $(NULL)
183
184 libentangle_frontend_la_SOURCES = \
185         frontend/entangle-window.h frontend/entangle-window.c \
186         frontend/entangle-application.h frontend/entangle-application.c \
187         frontend/entangle-camera-support.h frontend/entangle-camera-support.c \
188         frontend/entangle-camera-manager.h frontend/entangle-camera-manager.c \
189         frontend/entangle-camera-picker.h frontend/entangle-camera-picker.c \
190         frontend/entangle-camera-preferences.h frontend/entangle-camera-preferences.c \
191         frontend/entangle-control-panel.h frontend/entangle-control-panel.c \
192         frontend/entangle-dpms.h frontend/entangle-dpms.c \
193         frontend/entangle-help-about.h frontend/entangle-help-about.c \
194         frontend/entangle-image-display.h frontend/entangle-image-display.c \
195         frontend/entangle-image-histogram.h frontend/entangle-image-histogram.c \
196         frontend/entangle-image-popup.h frontend/entangle-image-popup.c \
197         frontend/entangle-image-statusbar.h frontend/entangle-image-statusbar.c \
198         frontend/entangle-preferences.h frontend/entangle-preferences.c \
199         frontend/entangle-preferences-display.h frontend/entangle-preferences-display.c \
200         frontend/entangle-session-browser.h frontend/entangle-session-browser.c \
201         frontend/entangle-overlay-box.h frontend/entangle-overlay-box.c \
202         frontend/entangle-auto-drawer.h frontend/entangle-auto-drawer.c \
203         frontend/entangle-drawer.h frontend/entangle-drawer.c
204
205 nodist_libentangle_frontend_la_SOURCES = \
206         frontend/entangle-image-display-enums.h frontend/entangle-image-display-enums.c \
207         $(NULL)
208
209 BUILT_SOURCES += $(nodist_libentangle_frontend_la_SOURCES)
210
211 libentangle_frontend_la_LIBADD = libentangle_backend.la
212
213 libentangle_frontend_la_LDFLAGS = \
214         $(GTHREAD_LIBS) \
215         $(GMODULE_LIBS) \
216         $(GTK_LIBS) \
217         $(LIBPEAS_LIBS) \
218         $(LIBPEAS_UI_LIBS) \
219         $(GEXIV2_LIBS) \
220         $(XEXT_LIBS) \
221         $(NULL)
222
223 libentangle_frontend_la_CFLAGS = \
224         -I$(srcdir)/backend \
225         -I$(builddir)/backend \
226         -I$(builddir)/frontend \
227         $(GTHREAD_CFLAGS) \
228         $(GMODULE_CFLAGS) \
229         $(GTK_CFLAGS) \
230         $(LIBPEAS_CFLAGS) \
231         $(LIBPEAS_UI_CFLAGS) \
232         $(GEXIV2_CFLAGS) \
233         $(XEXT_CFLAGS) \
234         $(WARN_CFLAGS) \
235         -DPKGDATADIR="\"$(pkgdatadir)\"" \
236         -DDATADIR="\"$(datadir)\"" \
237         -DLIBDIR="\"$(libdir)\"" \
238         -DG_LOG_DOMAIN="\"$(PACKAGE)\"" \
239         $(NULL)
240
241
242
243 entangle_SOURCES = entangle-main.c
244
245 entangle_LDADD = libentangle_frontend.la
246
247 entangle_LDFLAGS = \
248         $(GTHREAD_LIBS) \
249         $(GMODULE_LIBS) \
250         $(GTK_LIBS) \
251         $(GOBJECT_INTROSPECTION_LIBS) \
252         $(LIBPEAS_LIBS) \
253         $(NULL)
254
255 entangle_CFLAGS = \
256         -DLOCALE_DIR=\""$(datadir)/locale"\"            \
257         -I$(srcdir)/backend \
258         -I$(builddir)/backend \
259         -I$(srcdir)/frontend \
260         $(GTHREAD_FLAGS) \
261         $(GMODULE_FLAGS) \
262         $(GTK_CFLAGS) \
263         $(GOBJECT_INTROSPECTION_CFLAGS) \
264         $(LIBPEAS_CFLAGS) \
265         $(WARN_CFLAGS) \
266         -DPKGDATADIR="\"$(pkgdatadir)\"" \
267         -DDATADIR="\"$(datadir)\"" \
268         -DG_LOG_DOMAIN="\"$(PACKAGE)\"" \
269         $(NULL)
270
271
272 %.desktop.tmp: $(srcdir)/%.desktop.in
273         $(AM_V_GEN)sed -e "s,::DATADIR::,$(datadir),g" < $< > $@
274
275 %.desktop: %.desktop.tmp
276         $(AM_V_GEN)intltool-merge -d $(top_srcdir)/po $< $@
277
278 %.appdata.xml: %.appdata.xml.in
279         $(AM_V_GEN)intltool-merge -x $(top_srcdir)/po $< $@
280
281 backend/entangle-camera-enums.c: backend/entangle-camera.h backend/entangle-camera-enums.h Makefile.am
282         $(AM_V_GEN)glib-mkenums \
283                         --fhead "#include \"entangle-camera-enums.h\"\n\n" \
284                         --fprod "\n/* enumerations from \"@filename@\" */" \
285                         --fprod "\n#include \"@filename@\"\n" \
286                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
287                         --vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
288                         --vtail "  { 0, NULL, NULL }\n};\n\n" \
289                         --vtail "GType\n@enum_name@_get_type (void)\n{\n" \
290                         --vtail "  static GType type = 0;\n\n" \
291                         --vtail "  if (!type)\n" \
292                         --vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
293                         --vtail "  return type;\n}\n\n" \
294                 $< > $@
295
296 backend/entangle-camera-enums.h: backend/entangle-camera.h Makefile.am
297         $(AM_V_GEN)glib-mkenums \
298                         --fhead "#ifndef __ENTANGLE_CAMERA_ENUMS_H__\n" \
299                         --fhead "#define __ENTANGLE_CAMERA_ENUMS_H__\n\n" \
300                         --fhead "#include <glib-object.h>\n" \
301                         --fhead "G_BEGIN_DECLS\n\n" \
302                         --ftail "G_END_DECLS\n\n" \
303                         --ftail "#endif /* __ENTANGLE_CAMERA_ENUMS_H__ */\n" \
304                         --fprod "\n/* --- @filename@ --- */" \
305                         --eprod "#define ENTANGLE_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
306                         --eprod "GType @enum_name@_get_type (void);\n" \
307                 $< >  $@
308
309 backend/entangle-colour-profile-enums.c: backend/entangle-colour-profile.h backend/entangle-colour-profile-enums.h Makefile.am
310         $(AM_V_GEN)glib-mkenums \
311                         --fhead "#include \"entangle-colour-profile-enums.h\"\n\n" \
312                         --fprod "\n/* enumerations from \"@filename@\" */" \
313                         --fprod "\n#include \"@filename@\"\n" \
314                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
315                         --vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
316                         --vtail "  { 0, NULL, NULL }\n};\n\n" \
317                         --vtail "GType\n@enum_name@_get_type (void)\n{\n" \
318                         --vtail "  static GType type = 0;\n\n" \
319                         --vtail "  if (!type)\n" \
320                         --vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
321                         --vtail "  return type;\n}\n\n" \
322                 $< > $@
323
324 backend/entangle-colour-profile-enums.h: backend/entangle-colour-profile.h Makefile.am
325         $(AM_V_GEN)glib-mkenums \
326                         --fhead "#ifndef __ENTANGLE_COLOUR_PROFILE_ENUMS_H__\n" \
327                         --fhead "#define __ENTANGLE_COLOUR_PROFILE_ENUMS_H__\n\n" \
328                         --fhead "#include <glib-object.h>\n" \
329                         --fhead "G_BEGIN_DECLS\n\n" \
330                         --ftail "G_END_DECLS\n\n" \
331                         --ftail "#endif /* __ENTANGLE_COLOUR_PROFILE_ENUMS_H__ */\n" \
332                         --fprod "\n/* --- @filename@ --- */" \
333                         --eprod "#define ENTANGLE_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
334                         --eprod "GType @enum_name@_get_type (void);\n" \
335                 $< >  $@
336
337 backend/entangle-config-entry-enums.c: backend/entangle-config-entry.h backend/entangle-config-entry-enums.h Makefile.am
338         $(AM_V_GEN)glib-mkenums \
339                         --fhead "#include \"entangle-config-entry-enums.h\"\n\n" \
340                         --fprod "\n/* enumerations from \"@filename@\" */" \
341                         --fprod "\n#include \"@filename@\"\n" \
342                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
343                         --vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
344                         --vtail "  { 0, NULL, NULL }\n};\n\n" \
345                         --vtail "GType\n@enum_name@_get_type (void)\n{\n" \
346                         --vtail "  static GType type = 0;\n\n" \
347                         --vtail "  if (!type)\n" \
348                         --vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
349                         --vtail "  return type;\n}\n\n" \
350                 $< > $@
351
352 backend/entangle-config-entry-enums.h: backend/entangle-config-entry.h Makefile.am
353         $(AM_V_GEN)glib-mkenums \
354                         --fhead "#ifndef __ENTANGLE_COLOUR_PROFILE_ENUMS_H__\n" \
355                         --fhead "#define __ENTANGLE_COLOUR_PROFILE_ENUMS_H__\n\n" \
356                         --fhead "#include <glib-object.h>\n" \
357                         --fhead "G_BEGIN_DECLS\n\n" \
358                         --ftail "G_END_DECLS\n\n" \
359                         --ftail "#endif /* __ENTANGLE_COLOUR_PROFILE_ENUMS_H__ */\n" \
360                         --fprod "\n/* --- @filename@ --- */" \
361                         --eprod "#define ENTANGLE_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
362                         --eprod "GType @enum_name@_get_type (void);\n" \
363                 $< >  $@
364
365 frontend/entangle-image-display-enums.c: frontend/entangle-image-display.h frontend/entangle-image-display-enums.h Makefile.am
366         $(AM_V_GEN)glib-mkenums \
367                         --fhead "#include \"entangle-image-display-enums.h\"\n\n" \
368                         --fprod "\n/* enumerations from \"@filename@\" */" \
369                         --fprod "\n#include \"@filename@\"\n" \
370                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
371                         --vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
372                         --vtail "  { 0, NULL, NULL }\n};\n\n" \
373                         --vtail "GType\n@enum_name@_get_type (void)\n{\n" \
374                         --vtail "  static GType type = 0;\n\n" \
375                         --vtail "  if (!type)\n" \
376                         --vtail "    type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
377                         --vtail "  return type;\n}\n\n" \
378                 $< > $@
379
380 frontend/entangle-image-display-enums.h: frontend/entangle-image-display.h Makefile.am
381         $(AM_V_GEN)glib-mkenums \
382                         --fhead "#ifndef __ENTANGLE_IMAGE_DISPLAY_ENUMS_H__\n" \
383                         --fhead "#define __ENTANGLE_IMAGE_DISPLAY_ENUMS_H__\n\n" \
384                         --fhead "#include <glib-object.h>\n" \
385                         --fhead "G_BEGIN_DECLS\n\n" \
386                         --ftail "G_END_DECLS\n\n" \
387                         --ftail "#endif /* __ENTANGLE_IMAGE_DISPLAY_ENUMS_H__ */\n" \
388                         --fprod "\n/* --- @filename@ --- */" \
389                         --eprod "#define ENTANGLE_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
390                         --eprod "GType @enum_name@_get_type (void);\n" \
391                 $< >  $@
392
393 CLEANFILES = *~ \
394         $(nodist_libentangle_frontend_la_SOURCES) \
395         $(nodist_libentangle_backend_la_SOURCES) \
396         $(NULL)
397
398 MAINTAINERCLEANFILES = $(desktop_DATA) $(appdata_DATA)
399
400 Entangle-0.1.gir: entangle $(G_IR_SCANNER) Makefile.am
401         $(AM_V_GEN)$(G_IR_SCANNER) -v --warn-all \
402                 --namespace Entangle \
403                 --nsversion 0.1 \
404                 --include GObject-2.0 \
405                 --include Gtk-3.0 \
406                 --include Peas-1.0 \
407                 --include GExiv2-$(GEXIV2_GIR_VERSION) \
408                 --program=$(builddir)/entangle \
409                 --add-include-path=$(srcdir) \
410                 --add-include-path=$(builddir) \
411                 --output $@ \
412                 -I$(srcdir)/backend \
413                 -I$(srcdir)/frontend \
414                 -I$(builddir)/backend \
415                 -I$(builddir)/frontend \
416                 --verbose \
417                 --pkg=glib-2.0 \
418                 --pkg=gthread-2.0 \
419                 --pkg=gdk-pixbuf-2.0 \
420                 --pkg=gobject-2.0 \
421                 --pkg=gtk+-3.0 \
422                 --pkg=libgphoto2 \
423                 --pkg=libpeas-1.0 \
424                 --pkg=dbus-glib-1 \
425                 --pkg=gexiv2 \
426                 $(libentangle_backend_la_SOURCES:%=$(srcdir)/%) \
427                 $(nodist_libentangle_backend_la_SOURCES:%=$(builddir)/%) \
428                 $(libentangle_frontend_la_SOURCES:%=$(srcdir)/%) \
429                 $(nodist_libentangle_frontend_la_SOURCES:%=$(builddir)/%) \
430                 $(entangle_SOURCES:%=$(srcdir)/%)
431
432 girdir = $(datadir)/gir-1.0
433 gir_DATA = Entangle-0.1.gir
434
435 typelibsdir = $(libdir)/girepository-1.0
436 typelibs_DATA = Entangle-0.1.typelib
437
438 %.typelib: %.gir
439         $(AM_V_GEN)$(G_IR_COMPILER) \
440                 --includedir=$(srcdir) \
441                 --includedir=$(builddir) \
442                 -o $@ $<
443
444 CLEANFILES += Entangle-0.1.gir $(typelibs_DATA)