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