]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/Makefile.am
*** empty log message ***
[~andy/gtk] / gdk-pixbuf / Makefile.am
1
2 SUBDIRS = pixops
3
4 if PLATFORM_WIN32
5 no_undefined = -no-undefined
6 endif
7
8 if OS_WIN32
9 gdk_pixbuf_def = gdk_pixbuf.def
10 gdk_pixbuf_symbols = -export-symbols $(gdk_pixbuf_def)
11
12 gdk_pixbuf_win32res_lo = gdk_pixbuf-win32res.lo
13
14 gdk_pixbuf-win32res.lo : gdk_pixbuf.rc
15         $(top_srcdir)/build/win32/lt-compile-resource gdk_pixbuf.rc gdk_pixbuf-win32res.lo
16
17 install-libtool-import-lib:
18         $(INSTALL) .libs/libgdk_pixbuf-$(GTK_API_VERSION).dll.a $(DESTDIR)$(libdir)
19 uninstall-libtool-import-lib:
20         -rm $(DESTDIR)$(libdir)/libgdk_pixbuf-$(GTK_API_VERSION).dll.a
21 else
22 install-libtool-import-lib:
23 uninstall-libtool-import-lib:
24 endif
25
26 if MS_LIB_AVAILABLE
27 noinst_DATA = gdk_pixbuf-$(GTK_API_VERSION).lib
28
29 gdk_pixbuf-$(GTK_API_VERSION).lib: libgdk_pixbuf-$(GTK_API_VERSION).la gdk_pixbuf.def
30         lib -name:libgdk_pixbuf-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk_pixbuf.def -out:$@
31
32 install-ms-lib:
33         $(INSTALL) gdk_pixbuf-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
34
35 uninstall-ms-lib:
36         -rm $(DESTDIR)$(libdir)/gdk_pixbuf-$(GTK_API_VERSION).lib
37 else
38 install-ms-lib:
39 uninstall-ms-lib:
40 endif
41
42 gdk_pixbuf.def: gdk-pixbuf.symbols
43         (echo -e EXPORTS; cpp -P -DINCLUDE_VARIABLES $(srcdir)/gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/\t/') > gdk_pixbuf.def
44
45 gdk-pixbuf-alias.h: gdk-pixbuf.symbols
46          $(srcdir)/makegdkpixbufalias.pl < $(srcdir)/gdk-pixbuf.symbols > gdk-pixbuf-alias.h
47
48 if OS_UNIX
49 TESTS = abicheck.sh
50 endif
51
52 lib_LTLIBRARIES =               \
53         libgdk_pixbuf-2.0.la
54
55 loaderdir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/loaders
56
57 module_libs = libgdk_pixbuf-$(GTK_API_VERSION).la $(GDK_PIXBUF_DEP_LIBS)
58
59 #
60 # The PNG plugin.
61 #
62 libpixbufloader_png_la_SOURCES = io-png.c
63 libpixbufloader_png_la_LDFLAGS = -avoid-version -module $(no_undefined)
64 libpixbufloader_png_la_LIBADD = $(LIBPNG) $(module_libs)
65 libpixbufloader_static_png_la_SOURCES = io-png.c
66
67 #
68 # The JPEG loader
69 #
70 libpixbufloader_static_jpeg_la_SOURCES = io-jpeg.c
71 libpixbufloader_jpeg_la_SOURCES = io-jpeg.c
72 libpixbufloader_jpeg_la_LDFLAGS = -avoid-version -module $(no_undefined)
73 libpixbufloader_jpeg_la_LIBADD = $(LIBJPEG) $(module_libs)
74
75 #
76 # The XPM loader
77 #
78 libpixbufloader_static_xpm_la_SOURCES = io-xpm.c
79 libpixbufloader_xpm_la_SOURCES = io-xpm.c
80 libpixbufloader_xpm_la_LDFLAGS = -avoid-version -module $(no_undefined)
81 libpixbufloader_xpm_la_LIBADD = $(module_libs)
82
83 #
84 # The GIF loader
85 #
86 libpixbufloader_static_gif_la_SOURCES = io-gif.c io-gif-animation.c io-gif-animation.h
87 libpixbufloader_gif_la_SOURCES = io-gif.c io-gif-animation.c io-gif-animation.h
88 libpixbufloader_gif_la_LDFLAGS = -avoid-version -module $(no_undefined)
89 libpixbufloader_gif_la_LIBADD = $(module_libs)
90
91 #
92 # The ICO loader
93 #
94 libpixbufloader_static_ico_la_SOURCES = io-ico.c
95 libpixbufloader_ico_la_SOURCES = io-ico.c
96 libpixbufloader_ico_la_LDFLAGS = -avoid-version -module $(no_undefined)
97 libpixbufloader_ico_la_LIBADD = $(module_libs)
98
99 #
100 # The ANI loader
101 #
102 libpixbufloader_static_ani_la_SOURCES = io-ani.c io-ani-animation.c io-ani-animation.h
103 libpixbufloader_ani_la_SOURCES = io-ani.c io-ani-animation.c io-ani-animation.h
104 libpixbufloader_ani_la_LDFLAGS = -avoid-version -module $(no_undefined)
105 libpixbufloader_ani_la_LIBADD = $(module_libs)
106
107 #
108 # The RAS loader
109 #
110 libpixbufloader_static_ras_la_SOURCES = io-ras.c
111 libpixbufloader_ras_la_SOURCES = io-ras.c
112 libpixbufloader_ras_la_LDFLAGS = -avoid-version -module $(no_undefined)
113 libpixbufloader_ras_la_LIBADD = $(module_libs)
114
115 #
116 # The TIFF loader
117 #
118 libpixbufloader_static_tiff_la_SOURCES = io-tiff.c
119 libpixbufloader_tiff_la_SOURCES = io-tiff.c
120 libpixbufloader_tiff_la_LDFLAGS = -avoid-version -module $(no_undefined)
121 libpixbufloader_tiff_la_LIBADD = $(LIBTIFF) $(module_libs)
122
123 #
124 # The PNM loader
125 #
126 libpixbufloader_static_pnm_la_SOURCES = io-pnm.c
127 libpixbufloader_pnm_la_SOURCES = io-pnm.c
128 libpixbufloader_pnm_la_LDFLAGS = -avoid-version -module $(no_undefined)
129 libpixbufloader_pnm_la_LIBADD = $(module_libs)
130
131 #
132 # The BMP loader
133 #
134 libpixbufloader_static_bmp_la_SOURCES = io-bmp.c
135 libpixbufloader_bmp_la_SOURCES = io-bmp.c
136 libpixbufloader_bmp_la_LDFLAGS = -avoid-version -module $(no_undefined)
137 libpixbufloader_bmp_la_LIBADD = $(module_libs)
138
139 #
140 # The WBMP loader
141 #
142 libpixbufloader_static_wbmp_la_SOURCES = io-wbmp.c
143 libpixbufloader_wbmp_la_SOURCES = io-wbmp.c
144 libpixbufloader_wbmp_la_LDFLAGS = -avoid-version -module $(no_undefined)
145 libpixbufloader_wbmp_la_LIBADD = $(module_libs)
146
147 #
148 # The XBM loader
149 #
150 libpixbufloader_static_xbm_la_SOURCES = io-xbm.c
151 libpixbufloader_xbm_la_SOURCES = io-xbm.c
152 libpixbufloader_xbm_la_LDFLAGS = -avoid-version -module $(no_undefined)
153 libpixbufloader_xbm_la_LIBADD = $(module_libs)
154
155 #
156 # The TGA loader
157 #
158 libpixbufloader_static_tga_la_SOURCES = io-tga.c
159 libpixbufloader_tga_la_SOURCES = io-tga.c
160 libpixbufloader_tga_la_LDFLAGS = -avoid-version -module $(no_undefined)
161 libpixbufloader_tga_la_LIBADD = $(module_libs)
162
163 #
164 # The PCX loader
165 #
166 libpixbufloader_static_pcx_la_SOURCES = io-pcx.c
167 libpixbufloader_pcx_la_SOURCES = io-pcx.c
168 libpixbufloader_pcx_la_LDFLAGS = -avoid-version -module $(no_undefined)
169 libpixbufloader_pcx_la_LIBADD = $(module_libs)
170
171 if HAVE_PNG
172 PNG_LIB = libpixbufloader-png.la
173 STATIC_PNG_LIB = libpixbufloader-static-png.la
174 endif
175
176 if HAVE_JPEG
177 JPEG_LIB = libpixbufloader-jpeg.la
178 STATIC_JPEG_LIB = libpixbufloader-static-jpeg.la
179 endif
180
181 GIF_LIB = libpixbufloader-gif.la
182 STATIC_GIF_LIB = libpixbufloader-static-gif.la
183
184 ICO_LIB = libpixbufloader-ico.la
185 STATIC_ICO_LIB = libpixbufloader-static-ico.la
186
187 ANI_LIB = libpixbufloader-ani.la
188 STATIC_ANI_LIB = libpixbufloader-static-ani.la
189
190 RAS_LIB = libpixbufloader-ras.la
191 STATIC_RAS_LIB = libpixbufloader-static-ras.la
192
193 if HAVE_TIFF
194 TIFF_LIB = libpixbufloader-tiff.la
195 STATIC_TIFF_LIB = libpixbufloader-static-tiff.la
196 endif
197
198 XPM_LIB = libpixbufloader-xpm.la
199 STATIC_XPM_LIB = libpixbufloader-static-xpm.la
200
201 PNM_LIB = libpixbufloader-pnm.la
202 STATIC_PNM_LIB = libpixbufloader-static-pnm.la
203
204 BMP_LIB = libpixbufloader-bmp.la
205 STATIC_BMP_LIB = libpixbufloader-static-bmp.la
206
207 WBMP_LIB = libpixbufloader-wbmp.la
208 STATIC_WBMP_LIB = libpixbufloader-static-wbmp.la
209
210 XBM_LIB = libpixbufloader-xbm.la
211 STATIC_XBM_LIB = libpixbufloader-static-xbm.la
212
213 TGA_LIB = libpixbufloader-tga.la
214 STATIC_TGA_LIB = libpixbufloader-static-tga.la
215
216 PCX_LIB = libpixbufloader-pcx.la
217 STATIC_PCX_LIB = libpixbufloader-static-pcx.la
218
219 if BUILD_DYNAMIC_MODULES
220
221 loader_LTLIBRARIES =    \
222         $(PNG_LIB)      \
223         $(JPEG_LIB)     \
224         $(GIF_LIB)      \
225         $(ICO_LIB)      \
226         $(ANI_LIB)      \
227         $(RAS_LIB)      \
228         $(XPM_LIB)      \
229         $(TIFF_LIB)     \
230         $(PNM_LIB)      \
231         $(BMP_LIB)      \
232         $(WBMP_LIB)     \
233         $(XBM_LIB)      \
234         $(TGA_LIB)      \
235         $(PCX_LIB)
236
237
238 extra_sources = 
239 builtin_objs = 
240 else
241 loader_LTLIBRARIES = 
242
243 noinst_LTLIBRARIES =            \
244         $(STATIC_PNG_LIB)       \
245         $(STATIC_JPEG_LIB)      \
246         $(STATIC_GIF_LIB)       \
247         $(STATIC_ICO_LIB)       \
248         $(STATIC_ANI_LIB)       \
249         $(STATIC_RAS_LIB)       \
250         $(STATIC_XPM_LIB)       \
251         $(STATIC_TIFF_LIB)      \
252         $(STATIC_PNM_LIB)       \
253         $(STATIC_BMP_LIB)       \
254         $(STATIC_WBMP_LIB)      \
255         $(STATIC_XBM_LIB)       \
256         $(STATIC_TGA_LIB)       \
257         $(STATIC_PCX_LIB)
258
259 builtin_objs = @INCLUDED_LOADER_OBJ@
260
261 endif
262
263 DEPS = libgdk_pixbuf-$(GTK_API_VERSION).la
264 INCLUDES = \
265         -DG_LOG_DOMAIN=\"GdkPixbuf\"            \
266         -I$(top_srcdir) -I$(top_builddir)       \
267         -I$(top_srcdir)/gdk-pixbuf              \
268         -I$(top_builddir)/gdk-pixbuf            \
269         -DGTK_SYSCONFDIR=\"$(sysconfdir)\"      \
270         -DGTK_VERSION=\"$(GTK_VERSION)\"        \
271         -DGTK_BINARY_VERSION=\"$(GTK_BINARY_VERSION)\"  \
272         -DG_DISABLE_DEPRECATED                  \
273         -DGDK_PIXBUF_DISABLE_DEPRECATED         \
274         -DGTK_PREFIX=\"$(prefix)\"              \
275         $(INCLUDED_LOADER_DEFINE)               \
276         $(GTK_DEBUG_FLAGS)                      \
277         $(GDK_PIXBUF_DEP_CFLAGS)                \
278         -DGDK_PIXBUF_ENABLE_BACKEND
279
280 AM_CPPFLAGS = "-DPIXBUF_LIBDIR=\"$(loaderdir)\"" "-DBUILT_MODULES_DIR=\"$(srcdir)/.libs\""
281 LDADDS = libgdk_pixbuf-$(GTK_API_VERSION).la
282
283 noinst_PROGRAMS = test-gdk-pixbuf
284 test_gdk_pixbuf_LDADD = $(LDADDS)
285
286 bin_PROGRAMS = gdk-pixbuf-csource gdk-pixbuf-query-loaders
287 gdk_pixbuf_csource_SOURCES = gdk-pixbuf-csource.c
288 gdk_pixbuf_csource_LDADD = $(LDADDS)
289
290 gdk_pixbuf_query_loaders_DEPENDENCIES = $(DEPS)
291 gdk_pixbuf_query_loaders_LDADD = $(LDADDS)
292
293 gdk_pixbuf_query_loaders_SOURCES = queryloaders.c
294
295
296 #
297 # The GdkPixBuf library
298 #
299 libgdk_pixbufincludedir = $(includedir)/gtk-2.0/gdk-pixbuf
300 libgdk_pixbuf_2_0_la_SOURCES =  \
301         gdk-pixbuf-i18n.h       \
302         gdk-pixbuf.c            \
303         gdk-pixbuf-animation.c  \
304         gdk-pixbuf-data.c       \
305         gdk-pixbuf-io.c         \
306         gdk-pixbuf-loader.c     \
307         gdk-pixbuf-scale.c      \
308         gdk-pixbuf-util.c       \
309         gdk-pixdata.c           \
310         gdk-pixbuf-enum-types.c
311
312 libgdk_pixbuf_2_0_la_LDFLAGS = \
313         -version-info $(LT_VERSION_INFO)        \
314         $(LIBTOOL_EXPORT_OPTIONS)               \
315         $(no_undefined)                         \
316         $(gdk_pixbuf_symbols)
317
318
319 libgdk_pixbuf_2_0_la_LIBADD = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_win32res_lo) $(GDK_PIXBUF_DEP_LIBS)
320 libgdk_pixbuf_2_0_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_def) $(gdk_pixbuf_win32res_lo)
321
322 gdk_pixbuf_headers =                    \
323         gdk-pixbuf.h                    \
324         gdk-pixbuf-core.h               \
325         gdk-pixbuf-transform.h          \
326         gdk-pixbuf-io.h                 \
327         gdk-pixbuf-animation.h          \
328         gdk-pixbuf-loader.h
329
330 libgdk_pixbufinclude_HEADERS =          \
331         $(gdk_pixbuf_headers)           \
332         gdk-pixbuf-enum-types.h         \
333         gdk-pixbuf-marshal.h            \
334         gdk-pixbuf-features.h           \
335         gdk-pixdata.h
336
337 noinst_HEADERS =                \
338         gdk-pixbuf-alias.h      \
339         gdk-pixbuf-private.h
340
341 BUILT_SOURCES =                 \
342         gdk-pixbuf-alias.h      \
343         gdk-pixbuf-enum-types.h \
344         gdk-pixbuf-enum-types.c \
345         gdk-pixbuf-marshal.h    \
346         gdk-pixbuf-marshal.c
347
348 CLEANFILES =
349 MAINTAINERCLEANFILES =          \
350         gdk-pixbuf-enum-types.h \
351         gdk-pixbuf-enum-types.c \
352         gdk-pixbuf-marshal.h    \
353         gdk-pixbuf-marshal.c    \
354         gdk-pixbuf.loaders
355
356 #
357 # gdk-pixbuf-enum-types.h
358 #
359 gdk-pixbuf-enum-types.h: s-enum-types-h
360         @true
361
362 s-enum-types-h: @REBUILD@ $(gdk_pixbuf_headers) Makefile
363         ( cd $(srcdir) && glib-mkenums \
364                         --fhead "#ifndef __GDK_PIXBUF_ENUM_TYPES_H__\n#define __GDK_PIXBUF_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
365                         --fprod "/* enumerations from \"@filename@\" */\n" \
366                         --vhead "GType @enum_name@_get_type (void);\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
367                         --ftail "G_END_DECLS\n\n#endif /* __GDK_PIXBUF_ENUM_TYPES_H__ */" \
368                 $(gdk_pixbuf_headers) ) > tmp-gdk-pixbuf-enum-types.h \
369         && (cmp -s tmp-gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.h || cp tmp-gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.h ) \
370         && rm -f tmp-gdk-pixbuf-enum-types.h \
371         && echo timestamp > $(@F)
372
373 CLEANFILES += tmp-gdk-pixbuf-enum-types.h
374 MAINTAINERCLEANFILES += s-enum-types-h
375
376 #
377 # gdk-pixbuf-enum-types.c
378 #
379 gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) Makefile
380         (cd $(srcdir) && glib-mkenums \
381                 --fhead "#include \"gdk-pixbuf-alias.h\"\n#include <gdk-pixbuf/gdk-pixbuf.h>" \
382                 --fprod "\n/* enumerations from \"@filename@\" */" \
383                 --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"       \
384                 --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
385                 --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
386                   $(gdk_pixbuf_headers)) > gdk-pixbuf-enum-types.c
387
388 #
389 # gdk-pixbuf-marshal.h
390 #
391 gdk-pixbuf-marshal.h: @REBUILD@ stamp-gdk-pixbuf-marshal.h
392         @true
393
394 stamp-gdk-pixbuf-marshal.h: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
395         $(GLIB_GENMARSHAL) --prefix=_gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --header >> xgen-gmh \
396         && (cmp -s xgen-gmh gdk-pixbuf-marshal.h || cp xgen-gmh gdk-pixbuf-marshal.h) \
397         && rm -f xgen-gmh xgen-gmh~ \
398         && echo timestamp > $(@F)
399
400 CLEANFILES += xgen-gmh
401 MAINTAINERCLEANFILES += stamp-gdk-pixbuf-marshal.h
402
403 #
404 # gdk-pixbuf-marshal.c
405 #
406 $(srcdir)/gdk-pixbuf-marshal.c: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
407         (echo -e "#include \"gdk-pixbuf-alias.h\"" | $(GLIB_GENMARSHAL) --prefix=_gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body ) >> xgen-gmc \
408         && cp xgen-gmc gdk-pixbuf-marshal.c \
409         && rm -f xgen-gmc xgen-gmc~
410
411 CLEANFILES += xgen-gmc
412
413 # if srcdir!=builddir, clean out maintainer-clean files from builddir
414 # this allows dist to pass.
415 distclean-local:
416         if test $(srcdir) != .; then \
417           rm -f $(MAINTAINERCLEANFILES); \
418         fi
419
420 EXTRA_DIST =                                    \
421         gdk-pixbuf-csource.1                    \
422         makefile.msc                            \
423         gdk-pixbuf.symbols                      \
424         makegdkpixbufalias.pl                   \
425         abicheck.sh                             \
426         gdk_pixbuf.def                          \
427         gdk_pixbuf.rc                           \
428         gdk-pixbuf-marshal.c                    \
429         gdk-pixbuf-marshal.list                 \
430         pixbufloader_ico.def                    \
431         pixbufloader_ani.def                    \
432         pixbufloader_pnm.def                    \
433         pixbufloader_xpm.def                    \
434         pixbufloader_bmp.def                    \
435         pixbufloader_jpeg.def                   \
436         pixbufloader_ras.def                    \
437         pixbufloader_gif.def                    \
438         pixbufloader_png.def                    \
439         pixbufloader_tiff.def                   \
440         pixbufloader_wbmp.def                   \
441         pixbufloader_xbm.def                    \
442         pixbufloader_tga.def
443
444 if CROSS_COMPILING
445 RUN_QUERY_LOADER_TEST=false
446 else
447 RUN_QUERY_LOADER_TEST=test -z "$(DESTDIR)"
448 endif
449
450 # Running this if cross compiling or if DESTDIR is set is going to
451 # not work at all, so skip it
452 # We use install-data-hook here to workaround a bug in automake and/or libtool
453 # that makes the install target for the loader libraries a dependency on
454 # install-data-am, and not install-exec-am. We need to ensure this gets run
455 # after the libraries are installed in their final locations.
456 install-data-hook: install-ms-lib install-libtool-import-lib
457         @if $(RUN_QUERY_LOADER_TEST) ; then \
458           $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \
459           $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders > $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders ; \
460         else \
461           echo "***" ; \
462           echo "*** Warning: gdk-pixbuf.loaders not built" ; \
463           echo "***" ; \
464           echo "*** Generate this file manually on host" ; \
465           echo "*** system using gdk-pixbuf-query-loaders" ; \
466           echo "***" ; \
467         fi
468
469 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
470         rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders
471
472 if CROSS_COMPILING
473 else
474 all-local: gdk-pixbuf.loaders
475 endif
476
477 if BUILD_DYNAMIC_MODULES
478 gdk-pixbuf.loaders: $(loader_LTLIBRARIES) gdk-pixbuf-query-loaders
479         LOADERS=`echo libpixbufloader-*.la` ; \
480         if test "x$$LOADERS" != 'xlibpixbufloader-*.la' ; then \
481           echo "Writing a gdk-pixbuf.loader file to use when running examples before installing gdk-pixbuf."; \
482           $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders $$LOADERS > ./gdk-pixbuf.loaders ;\
483         else \
484           echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
485           touch gdk-pixbuf.loaders; \
486         fi
487 else
488 gdk-pixbuf.loaders: 
489         echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
490         touch gdk-pixbuf.loaders;
491 endif