summaryrefslogtreecommitdiffstats
path: root/gobject/Makefile.am
blob: d949401b9886b14b2a98346a2a34bed58d665cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# libguestfs
# Copyright (C) 2012 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

SUBDIRS = . docs

include $(top_srcdir)/subdir-rules.mk

include $(srcdir)/Makefile.inc

generator_built = \
	$(guestfs_gobject_headers) \
	$(guestfs_gobject_sources) \
	bindtests.js

BUILT_SOURCES = $(generator_built)

EXTRA_DIST = \
	$(generator_built) \
	TODO.txt \
	.gitignore \
	bindtests-manual.js \
	docs/.gitignore \
	tests-misc.js \
	run-tests \
	run-live-tests

# Remove the old generated files which were directly in the gobject/
# directory.  These have now moved into gobject/src/
CLEANFILES = \
	guestfs-gobject*.c *.o *.lo

libname = libguestfs-gobject-1.0.la

lib_LTLIBRARIES = $(libname)

libguestfs_gobject_1_0_ladir = $(includedir)/guestfs-gobject

libguestfs_gobject_1_0_la_HEADERS = $(guestfs_gobject_headers)
libguestfs_gobject_1_0_la_SOURCES = $(guestfs_gobject_sources)
libguestfs_gobject_1_0_la_CFLAGS = -I$(top_srcdir)/src -I$(srcdir)/include \
                                   $(GOBJECT_CFLAGS)
libguestfs_gobject_1_0_la_LIBS = $(GOBJECT_LIBS)
libguestfs_gobject_1_0_la_LDFLAGS = $(LDFLAGS) -L$(top_builddir)/src
libguestfs_gobject_1_0_la_LIBADD = -lguestfs

# All the headers except <guestfs-gobject.h> should be installed
# in the subdirectory.
install-data-hook:
	rm $(DESTDIR)$(includedir)/guestfs-gobject/guestfs-gobject.h
	install -m 0644 $(srcdir)/include/guestfs-gobject.h $(DESTDIR)$(includedir)

-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)

if HAVE_INTROSPECTION

introspection_sources = \
	$(libguestfs_gobject_1_0_la_HEADERS) \
	$(libguestfs_gobject_1_0_la_SOURCES)

Guestfs-1.0.gir: $(libname)
Guestfs_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
Guestfs_1_0_gir_CFLAGS = $(INCLUDES) -I$(srcdir)/include
Guestfs_1_0_gir_LIBS = $(libname)
Guestfs_1_0_gir_FILES = $(patsubst %,$(srcdir)/%,$(introspection_sources))
INTROSPECTION_GIRS += Guestfs-1.0.gir

girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)

typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)

TESTS = run-tests

if ENABLE_APPLIANCE
TESTS += run-live-tests
endif ENABLE_APPLIANCE

TESTS_ENVIRONMENT = $(top_builddir)/run --test

$(TESTS): $(typelib_DATA)

CLEANFILES += $(gir_DATA) $(typelib_DATA)

endif HAVE_INTROSPECTION