Makefile.am 13 KB
Newer Older
1
SUBDIRS = . gdk-pixbuf-loader tests tools doc win32
2

3
NULL =
4
BUILT_SOURCES =
5

6
lib_LTLIBRARIES = librsvg-@RSVG_API_MAJOR_VERSION@.la
7

8 9 10
bin_PROGRAMS = rsvg-convert
if HAVE_GTK_3
bin_PROGRAMS += rsvg-view-3
11
endif
12

13 14 15
headers =			\
	librsvg/rsvg.h		\
	librsvg/rsvg-cairo.h
Dom Lachowicz's avatar
Dom Lachowicz committed
16

17 18 19
enum_sources = 				\
	librsvg/librsvg-enum-types.h	\
	librsvg/librsvg-enum-types.c
20
BUILT_SOURCES += $(enum_sources)
Dom Lachowicz's avatar
Dom Lachowicz committed
21

22 23 24 25 26 27 28 29 30 31 32 33
librsvg_@RSVG_API_MAJOR_VERSION@_la_SOURCES =	\
	librsvg/librsvg-enum-types.c		\
	librsvg/librsvg-enum-types.h		\
	librsvg/librsvg-features.c 		\
	librsvg/librsvg-features.h 		\
	librsvg/rsvg-attributes.h		\
	librsvg/rsvg-base.c			\
	librsvg/rsvg-cairo.h			\
	librsvg/rsvg-css.h 			\
	librsvg/rsvg-handle.c			\
	librsvg/rsvg-io.c			\
	librsvg/rsvg-io.h			\
34 35
	librsvg/rsvg-load.c			\
	librsvg/rsvg-load.h			\
36
	librsvg/rsvg-pixbuf.c			\
37 38 39 40
	librsvg/rsvg-private.h 			\
	librsvg/rsvg-size-callback.c		\
	librsvg/rsvg-size-callback.h		\
	librsvg/rsvg.h				\
41
	$(NULL)
Caleb Michael Moore's avatar
Caleb Michael Moore committed
42

43 44 45 46 47 48 49 50 51 52 53
RUST_SRC =							\
	Cargo.toml						\
	rsvg_internals/Cargo.toml				\
	rsvg_internals/build.rs					\
	rsvg_internals/src/aspect_ratio.rs			\
	rsvg_internals/src/attributes.rs			\
	rsvg_internals/src/bbox.rs				\
	rsvg_internals/src/clip_path.rs				\
	rsvg_internals/src/color.rs				\
	rsvg_internals/src/cond.rs				\
	rsvg_internals/src/coord_units.rs			\
54
	rsvg_internals/src/croco.rs				\
55
	rsvg_internals/src/css.rs				\
56 57 58 59
	rsvg_internals/src/defs.rs				\
	rsvg_internals/src/drawing_ctx.rs			\
	rsvg_internals/src/filters/bounds.rs			\
	rsvg_internals/src/filters/blend.rs			\
Ivan Molodetskikh's avatar
Ivan Molodetskikh committed
60
	rsvg_internals/src/filters/color_matrix.rs		\
61
	rsvg_internals/src/filters/component_transfer.rs	\
62
	rsvg_internals/src/filters/composite.rs			\
63
	rsvg_internals/src/filters/convolve_matrix.rs		\
64
	rsvg_internals/src/filters/context.rs			\
65
	rsvg_internals/src/filters/displacement_map.rs		\
66 67
	rsvg_internals/src/filters/error.rs			\
	rsvg_internals/src/filters/flood.rs			\
Ivan Molodetskikh's avatar
Ivan Molodetskikh committed
68
	rsvg_internals/src/filters/gaussian_blur.rs		\
69
	rsvg_internals/src/filters/image.rs			\
70
	rsvg_internals/src/filters/light/light_source.rs	\
71
	rsvg_internals/src/filters/light/lighting.rs		\
72
	rsvg_internals/src/filters/light/mod.rs			\
73
	rsvg_internals/src/filters/merge.rs			\
Ivan Molodetskikh's avatar
Ivan Molodetskikh committed
74
	rsvg_internals/src/filters/morphology.rs		\
75 76 77 78
	rsvg_internals/src/filters/mod.rs			\
	rsvg_internals/src/filters/node.rs			\
	rsvg_internals/src/filters/input.rs			\
	rsvg_internals/src/filters/offset.rs			\
Ivan Molodetskikh's avatar
Ivan Molodetskikh committed
79
	rsvg_internals/src/filters/tile.rs			\
Ivan Molodetskikh's avatar
Ivan Molodetskikh committed
80
	rsvg_internals/src/filters/turbulence.rs		\
81 82
	rsvg_internals/src/error.rs				\
	rsvg_internals/src/float_eq_cairo.rs			\
83
	rsvg_internals/src/font_props.rs			\
84 85 86 87 88 89
	rsvg_internals/src/gradient.rs				\
	rsvg_internals/src/handle.rs				\
	rsvg_internals/src/image.rs				\
	rsvg_internals/src/iri.rs				\
	rsvg_internals/src/length.rs				\
	rsvg_internals/src/lib.rs				\
90
	rsvg_internals/src/log.rs				\
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
	rsvg_internals/src/link.rs				\
	rsvg_internals/src/load.rs				\
	rsvg_internals/src/marker.rs				\
	rsvg_internals/src/mask.rs				\
	rsvg_internals/src/node.rs				\
	rsvg_internals/src/paint_server.rs			\
	rsvg_internals/src/parsers.rs				\
	rsvg_internals/src/path_builder.rs			\
	rsvg_internals/src/path_parser.rs			\
	rsvg_internals/src/pattern.rs				\
	rsvg_internals/src/property_bag.rs			\
	rsvg_internals/src/property_macros.rs			\
	rsvg_internals/src/rect.rs				\
	rsvg_internals/src/shapes.rs				\
	rsvg_internals/src/surface_utils/iterators.rs		\
	rsvg_internals/src/surface_utils/mod.rs			\
	rsvg_internals/src/surface_utils/shared_surface.rs	\
	rsvg_internals/src/space.rs				\
	rsvg_internals/src/srgb.rs				\
	rsvg_internals/src/state.rs				\
	rsvg_internals/src/stop.rs				\
	rsvg_internals/src/structure.rs				\
113
	rsvg_internals/src/style.rs				\
114 115
	rsvg_internals/src/text.rs				\
	rsvg_internals/src/transform.rs				\
Paolo Borelli's avatar
Paolo Borelli committed
116
	rsvg_internals/src/tree.rs				\
117 118 119
	rsvg_internals/src/unitinterval.rs			\
	rsvg_internals/src/util.rs				\
	rsvg_internals/src/viewbox.rs				\
120 121
	rsvg_internals/src/viewport.rs				\
	rsvg_internals/src/xml.rs
122

123 124 125 126 127 128 129 130
RUST_EXTRA = 						\
	Cargo.lock					\
	cargo-vendor-config				\
	rsvg_internals/benches/box_blur.rs		\
	rsvg_internals/benches/composite.rs		\
	rsvg_internals/benches/lighting.rs		\
	rsvg_internals/benches/pixel_iterators.rs	\
	rsvg_internals/benches/srgb.rs
131

132 133 134 135 136 137
if DEBUG_RELEASE
CARGO_RELEASE_ARGS=
else
CARGO_RELEASE_ARGS=--release
endif

138
if CROSS_COMPILING
139
CARGO_TARGET_ARGS=--target=$(RUST_TARGET)
140 141
endif

142 143 144 145 146
CARGO_VERBOSE = $(cargo_verbose_$(V))
cargo_verbose_ = $(cargo_verbose_$(AM_DEFAULT_VERBOSITY))
cargo_verbose_0 =
cargo_verbose_1 = --verbose

147 148
RUST_LIB=@abs_top_builddir@/target/@RUST_TARGET_SUBDIR@/librsvg_internals.a
CARGO_TARGET_DIR=@abs_top_builddir@/target
149

150
check-local:
151
	cd $(srcdir) && \
152
	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) cargo test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS)
153 154

clean-local:
155
	cd $(top_srcdir) && \
156
	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) cargo clean
157

158 159 160 161 162 163 164
distcheck-hook:
	if test -z "${DESTDIR}";						\
	then									\
		echo "Please specify DESTDIR=/tmp/foo so distcheck will work";	\
		exit 1;								\
	fi

165
dist-hook:
166 167 168
	(cd $(distdir) &&							\
	cargo vendor -q &&							\
	mkdir .cargo &&								\
169 170
	cp cargo-vendor-config .cargo/config)

171 172
$(RUST_LIB): $(RUST_SRC)
	+cd $(top_srcdir)/rsvg_internals &&					\
173 174
	PKG_CONFIG_ALLOW_CROSS=1						\
	PKG_CONFIG='$(PKG_CONFIG)'						\
175
	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR)					\
176
	cargo build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS)
177

178 179 180
librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
	-I$(top_srcdir) 			\
	-I$(top_builddir) 			\
181
	-I$(top_builddir)/librsvg 		\
182 183
	-DG_LOG_DOMAIN=\"librsvg\" 		\
	-DLIBRSVG_DATADIR="\"$(datadir)\""	\
184
	-DSRCDIR=\""${abs_top_srcdir}"\"	\
185
	-DRSVG_DISABLE_DEPRECATION_WARNINGS	\
186 187 188
	$(AM_CPPFLAGS)

librsvg_@RSVG_API_MAJOR_VERSION@_la_CFLAGS = \
189
	-DRSVG_COMPILATION	\
190 191 192
	$(LIBRSVG_CFLAGS) 	\
	$(AM_CFLAGS)

193 194 195 196 197
librsvg_@RSVG_API_MAJOR_VERSION@_la_LDFLAGS = \
	$(BSYMBOLIC_LDFLAG) \
	-version-info @RSVG_LT_VERSION_INFO@ \
	-export-dynamic \
	-no-undefined \
198
	-export-symbols-regex "^rsvg_.*" \
199
	$(AM_LDFLAGS)
200 201

librsvg_@RSVG_API_MAJOR_VERSION@_la_LIBADD = \
202
	$(RUST_LIB)		\
203
	$(LIBRSVG_LIBS) 	\
204
	$(LIBM)			\
205
	$(DLOPEN_LIBS)
206

207
librsvgincdir = $(includedir)/librsvg-$(RSVG_API_VERSION)/librsvg
208 209 210 211
librsvginc_HEADERS =			\
	$(headers)			\
	librsvg/librsvg-features.h	\
	librsvg/librsvg-enum-types.h
212

213
dist_man_MANS = rsvg-convert.1
214

215 216 217 218
rsvg_convert_SOURCES =			\
	rsvg-convert.c			\
	librsvg/rsvg-size-callback.c	\
	librsvg/rsvg-size-callback.h	\
219
	$(NULL)
220 221 222 223

rsvg_convert_CPPFLAGS = \
	-I$(top_srcdir) 			\
	-I$(top_builddir) 			\
224
	-I$(top_builddir)/librsvg 		\
225 226 227 228
	-DLIBRSVG_DATADIR="\"$(datadir)\""	\
	$(AM_CPPFLAGS)

rsvg_convert_CFLAGS =\
229
	$(RSVG_CONVERT_CFLAGS) \
230 231 232
	$(AM_CFLAGS)

rsvg_convert_LDFLAGS = $(AM_LDFLAGS)
233

234 235
rsvg_convert_LDADD = \
	$(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la	\
236
	$(RSVG_CONVERT_LIBS) \
237
	$(LIBM)
238

239 240 241
rsvg_view_3_SOURCES =			\
	rsvg-view.c			\
	librsvg/rsvg-size-callback.h
242 243 244

rsvg_view_3_CPPFLAGS = \
	-I$(top_srcdir) 			\
245
	-I$(top_builddir)/librsvg 		\
246 247 248 249 250 251 252 253 254 255 256 257 258 259
	-DLIBRSVG_DATADIR="\"$(datadir)\""	\
	$(AM_CPPFLAGS)

rsvg_view_3_CFLAGS =\
	$(GTK3_CFLAGS)		\
	$(LIBRSVG_CFLAGS) 	\
	$(AM_CFLAGS)

rsvg_view_3_LDFLAGS =

rsvg_view_3_LDADD = \
	$(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \
	$(GTK3_LIBS)		\
	$(LIBRSVG_LIBS)		\
260
	$(GTHREAD_LIBS)		\
261
	$(LIBM)
262

263 264 265 266
if OS_WIN32
rsvg_view_3_LDFLAGS += -mwindows
endif # OS_WIN32

267 268 269 270
dist_doc_DATA =				\
	COMPILING.md			\
	CONTRIBUTING.md			\
	README.md			\
271
	code-of-conduct.md
272

273
EXTRA_DIST =				\
274
	$(RUST_SRC)			\
275
	$(RUST_EXTRA)			\
276
	librsvg.doap			\
277 278
	AUTHORS				\
	NEWS				\
279 280
	COPYING.LIB 			\
	librsvg-zip.in 			\
281 282
	gtk-doc.make			\
	Rsvg-2.0-custom.vala		\
283 284
	Rsvg-2.0.metadata		\
	config.h.win32.in		\
285
	config.h.win32			\
286 287 288 289
	rsvg.symbols			\
	glib-tap.mk			\
	tap-driver.sh			\
	tap-test
290

Dom Lachowicz's avatar
Dom Lachowicz committed
291 292
CLEANFILES = \
	$(enum_sources) \
293
	librsvg/s-enum-types-h librsvg/s-enum-types-c
Dom Lachowicz's avatar
Dom Lachowicz committed
294

295 296 297 298
## Put `exec' in the name because this should be installed by
## `install-exec', not `install-data'.

pkgconfigdir = $(libdir)/pkgconfig
299
pkgconfig_DATA = librsvg-$(RSVG_API_VERSION).pc
300

301
librsvg/librsvg-enum-types.h: librsvg/s-enum-types-h
Dom Lachowicz's avatar
Dom Lachowicz committed
302 303
	@true

304
librsvg/s-enum-types-h: $(headers) Makefile
305
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
306
			--fhead "#if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION)\n#warning \"Including <librsvg/librsvg-enum-types.h> directly is deprecated.\"\n#endif\n\n#ifndef __LIBRSVG_ENUM_TYPES_H__\n#define __LIBRSVG_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
Dom Lachowicz's avatar
Dom Lachowicz committed
307 308 309
			--fprod "/* enumerations from \"@filename@\" */\n" \
			--vhead "GType @enum_name@_get_type (void);\n#define RSVG_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" 	\
			--ftail "G_END_DECLS\n\n#endif /* __LIBRSVG_ENUM_TYPES_H__ */" \
310 311 312
		$(headers) ) > librsvg/tmp-librsvg-enum-types.h \
	&& (cmp -s librsvg/tmp-librsvg-enum-types.h librsvg/librsvg-enum-types.h || cp librsvg/tmp-librsvg-enum-types.h librsvg/librsvg-enum-types.h ) \
	&& rm -f librsvg/tmp-librsvg-enum-types.h	\
313
	&& echo timestamp > $@
Dom Lachowicz's avatar
Dom Lachowicz committed
314

315
librsvg/librsvg-enum-types.c: librsvg/s-enum-types-c librsvg/librsvg-enum-types.h
Dom Lachowicz's avatar
Dom Lachowicz committed
316 317
	@true

318
librsvg/s-enum-types-c: $(headers) Makefile
319
	$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
320
			--fhead "#include \"librsvg/rsvg.h\"" \
Dom Lachowicz's avatar
Dom Lachowicz committed
321 322 323 324
			--fprod "\n/* enumerations from \"@filename@\" */" \
			--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[] = {" 	\
			--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
325 326 327
		$(headers) ) > librsvg/tmp-librsvg-enum-types.c \
	&& (cmp -s librsvg/tmp-librsvg-enum-types.c librsvg/librsvg-enum-types.c || cp librsvg/tmp-librsvg-enum-types.c librsvg/librsvg-enum-types.c ) \
	&& rm -f librsvg/tmp-librsvg-enum-types.c \
328
	&& echo timestamp > $@
329 330

DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
331

332 333 334 335
if HAVE_INTROSPECTION
-include $(INTROSPECTION_MAKEFILE)

INTROSPECTION_GIRS = Rsvg-@RSVG_API_VERSION@.gir
Evan Nemerson's avatar
Evan Nemerson committed
336
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --symbol-prefix=rsvg --symbol-prefix=librsvg
337 338
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)

339
Rsvg-@RSVG_API_VERSION@.gir: librsvg-@RSVG_API_MAJOR_VERSION@.la
340 341 342

Rsvg_@RSVG_API_VERSION_U@_gir_NAMESPACE = Rsvg
Rsvg_@RSVG_API_VERSION_U@_gir_EXPORT_PACKAGES = librsvg-$(RSVG_API_VERSION)
343 344 345 346
Rsvg_@RSVG_API_VERSION_U@_gir_FILES = \
	$(librsvginc_HEADERS) \
	$(filter-out %.h,$(librsvg_@RSVG_API_MAJOR_VERSION@_la_SOURCES)) \
	$(NULL)
347 348 349 350 351 352 353 354
Rsvg_@RSVG_API_VERSION_U@_gir_INCLUDES = \
	GLib-2.0 \
	GObject-2.0 \
	Gio-2.0 \
	cairo-1.0 \
	GdkPixbuf-2.0 \
	$(NULL)
Rsvg_@RSVG_API_VERSION_U@_gir_PACKAGES = \
355 356
	pango \
	libxml-2.0 \
357
	$(NULL)
358
Rsvg_@RSVG_API_VERSION_U@_gir_CFLAGS = -I$(top_builddir) -I$(top_builddir)/librsvg -DRSVG_COMPILATION
359
Rsvg_@RSVG_API_VERSION_U@_gir_LIBS = librsvg-@RSVG_API_MAJOR_VERSION@.la
360
Rsvg_@RSVG_API_VERSION_U@_gir_SCANNERFLAGS = --c-include="librsvg/rsvg.h"
361 362

girdir = $(datadir)/gir-1.0
Christian Persch's avatar
Christian Persch committed
363
nodist_gir_DATA = $(INTROSPECTION_GIRS)
364 365

typelibsdir = $(libdir)/girepository-1.0
Christian Persch's avatar
Christian Persch committed
366
nodist_typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
367

Christian Persch's avatar
Christian Persch committed
368
CLEANFILES += $(nodist_gir_DATA) $(nodist_typelibs_DATA)
369

Evan Nemerson's avatar
Evan Nemerson committed
370 371 372 373 374 375 376 377 378
if ENABLE_VAPIGEN
include $(VAPIGEN_MAKEFILE)

librsvg-$(RSVG_API_VERSION).vapi: Rsvg-$(RSVG_API_VERSION).gir

VAPIGEN_VAPIS = librsvg-$(RSVG_API_VERSION).vapi

librsvg_@RSVG_API_VERSION_U@_vapi_DEPS = gio-2.0 cairo
librsvg_@RSVG_API_VERSION_U@_vapi_METADATADIRS = $(srcdir)
379
librsvg_@RSVG_API_VERSION_U@_vapi_FILES = Rsvg-$(RSVG_API_VERSION).gir $(srcdir)/Rsvg-$(RSVG_API_VERSION)-custom.vala
Evan Nemerson's avatar
Evan Nemerson committed
380 381 382 383 384 385 386 387

vapidir = $(datadir)/vala/vapi
vapi_DATA = $(VAPIGEN_VAPIS)

CLEANFILES += $(VAPIGEN_VAPIS)

endif # ENABLE_VAPIGEN

388 389
endif # HAVE_INTROSPECTION

390 391 392 393 394 395
# ------------------- MSVC Build Items ----------------

MSVCPROJS = rsvg rsvg-convert

rsvg_FILES = $(librsvg_@RSVG_API_MAJOR_VERSION@_la_SOURCES)
rsvg_EXCLUDES = dummy
396
rsvg_HEADERS_DIR = $(includedir)/librsvg-$(RSVG_API_VERSION)
397 398 399 400 401 402 403
rsvg_HEADERS_INST = $(librsvginc_HEADERS)

rsvg_HEADERS_EXCLUDES = dummy

rsvg_convert_FILES = $(rsvg_convert_SOURCES)
rsvg_convert_EXCLUDES = dummy

404
include $(top_srcdir)/win32/Makefile.msvcproj
405 406 407

# autotools: Why must we do this instead of dist-hook?
MSVCPROJ_GENERATED = \
408 409
	$(top_builddir)/win32/vs12/rsvg.vcxproj		\
	$(top_builddir)/win32/vs12/rsvg-convert.vcxproj
410

411 412 413 414 415
if HAVE_INTROSPECTION

MSVC_INTROSPECT_GIRS = $(INTROSPECTION_GIRS)

INTROSPECTION_INTERMEDIATE_ITEMS = \
416 417
	$(top_builddir)/win32/Rsvg-@RSVG_API_VERSION@.gir.msvc.introspect		\
	$(top_builddir)/win32/Rsvg_@RSVG_API_VERSION_U@_gir_list
418 419 420 421 422 423

Rsvg_@RSVG_API_VERSION_U@_gir_MSVC_FILES = $(Rsvg_@RSVG_API_VERSION_U@_gir_FILES)
Rsvg_@RSVG_API_VERSION_U@_gir_MSVC_PACKAGES = $(Rsvg_@RSVG_API_VERSION_U@_gir_PACKAGES)
Rsvg_@RSVG_API_VERSION_U@_gir_MSVC_EXPORT_PACKAGES = $(Rsvg_@RSVG_API_VERSION_U@_gir_EXPORT_PACKAGES)
Rsvg_@RSVG_API_VERSION_U@_gir_MSVC_INCLUDE_GIRS = $(Rsvg_@RSVG_API_VERSION_U@_gir_INCLUDES)
Rsvg_@RSVG_API_VERSION_U@_gir_MSVC_LIBS = rsvg-@RSVG_API_VERSION@
424
Rsvg_@RSVG_API_VERSION_U@_gir_MSVC_CFLAGS = -I.. -DRSVG_COMPILATION
425 426 427 428
Rsvg_@RSVG_API_VERSION_U@_gir_MSVC_SCANNERFLAGS = $(Rsvg_@RSVG_API_VERSION_U@_gir_SCANNERFLAGS)

MSVCPROJ_GENERATED += $(INTROSPECTION_INTERMEDIATE_ITEMS)

429
include $(top_srcdir)/win32/Makefile.msvc-introspection
430 431
endif # HAVE_INTROSPECTION

432
$(MSVCPROJ_GENERATED): $(top_builddir)/win32/vs12/rsvg.vs12.headers
433 434

EXTRA_DIST += $(MSVCPROJ_GENERATED)