Makefile.am 5.9 KB
Newer Older
D
Daniel Veillard 已提交
1 2
## Process this file with automake to produce Makefile.in

3 4 5
INCLUDES = \
	   -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	   -I../include \
6 7
	   -I@top_srcdir@/include \
	   -I@top_srcdir@/qemud \
8 9
	   $(LIBXML_CFLAGS) \
	   $(GNUTLS_CFLAGS) \
10
	   $(SASL_CFLAGS) \
11
	   $(SELINUX_CFLAGS) \
12
	   $(NUMACTL_CFLAGS) \
13 14 15 16
	   -DBINDIR=\""$(libexecdir)"\" \
	   -DSBINDIR=\""$(sbindir)"\" \
	   -DSYSCONF_DIR="\"$(sysconfdir)\"" \
	   -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
D
Daniel P. Berrange 已提交
17
           -DLOCAL_STATE_DIR=\""$(localstatedir)"\" \
18 19 20
           -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
	   $(WARN_CFLAGS) \
	   $(LIBVIRT_FEATURES)
21
DEPS = libvirt.la
22
LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) libvirt.la ../gnulib/lib/libgnu.la
K
Karel Zak 已提交
23
VIRSH_LIBS = @VIRSH_LIBS@
D
Daniel Veillard 已提交
24

25 26 27 28 29
confdir = $(sysconfdir)/libvirt/
conf_DATA = qemu.conf


EXTRA_DIST = libvirt_sym.version $(conf_DATA)
30

31
lib_LTLIBRARIES = libvirt.la
32 33

CLIENT_SOURCES =						\
34
		libvirt.c internal.h				\
35
		gnutls_1_0_compat.h				\
36
		socketcompat.h					\
37
                memory.c memory.h				\
38
		hash.c hash.h					\
39
		test.c test.h                                   \
40
                buf.c buf.h					\
41
		qparams.c qparams.h				\
42
                domain_conf.c domain_conf.h                     \
43
                capabilities.c capabilities.h			\
44
		xml.c xml.h					\
45
		event.c event.h					\
46
		xen_unified.c xen_unified.h			\
47
		xen_internal.c xen_internal.h			\
48
		xs_internal.c xs_internal.h			\
49
		xend_internal.c xend_internal.h			\
50
		stats_linux.c stats_linux.h			\
51
		sexpr.c sexpr.h					\
52
		virterror.c					\
53
		driver.h					\
D
Daniel Veillard 已提交
54
		proxy_internal.c proxy_internal.h		\
55
		conf.c conf.h                                   \
56
		network_conf.c network_conf.h                   \
D
Daniel P. Berrange 已提交
57
		xm_internal.c xm_internal.h                     \
58
		remote_internal.c remote_internal.h		\
59 60 61 62
		bridge.c bridge.h				\
		iptables.c iptables.h				\
		uuid.c uuid.h					\
		qemu_driver.c qemu_driver.h			\
63 64
		qemu_conf.c qemu_conf.h				\
		openvz_conf.c openvz_conf.h			\
65
		openvz_driver.c openvz_driver.h			\
D
Daniel Veillard 已提交
66
		lxc_driver.c lxc_driver.h			\
67
		lxc_controller.c lxc_controller.h		\
D
Daniel Veillard 已提交
68
		lxc_conf.c lxc_conf.h				\
R
Richard W.M. Jones 已提交
69
		lxc_container.c lxc_container.h			\
70
		veth.c veth.h			\
71
                nodeinfo.h nodeinfo.c                           \
72
		util.c util.h
73

74
SERVER_SOURCES =						\
75 76
		../qemud/remote_protocol.c ../qemud/remote_protocol.h

R
Richard W.M. Jones 已提交
77 78 79 80 81 82 83 84
if WITH_LIBVIRTD

CLIENT_SOURCES += 						\
		storage_conf.h storage_conf.c			\
		storage_driver.h storage_driver.c		\
		storage_backend.h storage_backend.c		\
		storage_backend_fs.h storage_backend_fs.c

85 86 87 88 89 90
if WITH_STORAGE_LVM
CLIENT_SOURCES += storage_backend_logical.h storage_backend_logical.c
else
EXTRA_DIST += storage_backend_logical.h storage_backend_logical.c
endif

91 92 93 94 95 96
if WITH_STORAGE_ISCSI
CLIENT_SOURCES +=  storage_backend_iscsi.h storage_backend_iscsi.c
else
EXTRA_DIST +=  storage_backend_iscsi.h storage_backend_iscsi.c
endif

97 98 99 100 101 102
if WITH_STORAGE_DISK
CLIENT_SOURCES += storage_backend_disk.h storage_backend_disk.c
else
EXTRA_DIST += storage_backend_disk.h storage_backend_disk.c
endif

R
Richard W.M. Jones 已提交
103
endif
104 105


106
libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES)
107
libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) $(SELINUX_LIBS) \
108
                    $(NUMACTL_LIBS) \
109
		    @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
110 111 112
libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
                     -version-info @LIBVIRT_VERSION_INFO@ \
                    $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
113
		    @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
114
libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
115

116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
# Create an automake "convenience library" version of libvirt_la,
# just for testing, since the test harness requires access to internal
# bits and pieces that we don't want to make publicly accessible.
noinst_LTLIBRARIES = libvirt_test.la

# Convert libvirt_sym.version
#      to libvirt_test_sym.version, and
# remove -version-info X.Y.Z (not needed since this is a convenience library.
test_LDFLAGS =						\
  $$(echo '$(libvirt_la_LDFLAGS)'			\
     |sed 's!-Wl,--v.*_sym\.version!!'			\
     |sed 's!-version-info @LIBVIRT_VERSION_INFO@!!')

# Just like the above, but with a slightly different set of public symbols.
libvirt_test_la_SOURCES = $(libvirt_la_SOURCES)
libvirt_test_la_LIBADD = $(libvirt_la_LIBADD)
libvirt_test_la_LDFLAGS = $(test_LDFLAGS)
libvirt_test_la_CFLAGS = $(COVERAGE_CFLAGS)

K
Karel Zak 已提交
135
bin_PROGRAMS = virsh
136

J
Jim Meyering 已提交
137
virsh_SOURCES = virsh.c console.c console.h util-lib.c util-lib.h
138
virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
139
virsh_DEPENDENCIES = $(DEPS)
K
Karel Zak 已提交
140
virsh_LDADD = $(LDADDS) $(VIRSH_LIBS)
141
virsh_CFLAGS = $(COVERAGE_CFLAGS) $(READLINE_CFLAGS)
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
BUILT_SOURCES = virsh-net-edit.c virsh-pool-edit.c

virsh-net-edit.c: virsh.c Makefile.am
	rm -f $@-tmp
	echo '/* Automatically generated from: $^ */' > $@-tmp
	echo 'static int' >> $@-tmp
	awk '/^cmdEdit/, /^}/' $< \
	  | sed -e 's/domain/network/g' \
	      -e 's/Domain/Network/g' \
	      -e 's/cmdEdit/cmdNetworkEdit/g' \
	      -e 's/dom/network/g' \
	>> $@-tmp
	chmod a-w $@-tmp
	rm -f $@
	mv $@-tmp $@

virsh-pool-edit.c: virsh.c Makefile.am
	rm -f $@-tmp
	echo '/* Automatically generated from: $^ */' > $@-tmp
	echo 'static int' >> $@-tmp
	awk '/^cmdEdit/, /^}/' $< \
	  | sed -e 's/domain/pool/g' \
	      -e 's/vshCommandOptDomain/vshCommandOptPool/g' \
	      -e 's/Domain %s/Pool %s/g' \
	      -e 's/Domain/StoragePool/g' \
	      -e 's/cmdEdit/cmdPoolEdit/g' \
	      -e 's/\(virStoragePoolDefineXML.*\));/\1, 0);/' \
	      -e 's/dom/pool/g' \
	>> $@-tmp
	chmod a-w $@-tmp
	rm -f $@
	mv $@-tmp $@
174

175
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
176
if WITH_LIBVIRTD
177 178 179 180 181 182
libexec_PROGRAMS = libvirt_parthelper

libvirt_parthelper_SOURCES = parthelper.c
libvirt_parthelper_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS)
libvirt_parthelper_LDADD = $(LIBPARTED_LIBS)
libvirt_parthelper_CFLAGS =  $(LIBPARTED_CFLAGS)
R
Richard W.M. Jones 已提交
183
endif
184 185 186 187
else
EXTRA_DIST += parthelper.c
endif

R
Richard W.M. Jones 已提交
188 189
# Create the /var/cache/libvirt directory when installing.
install-exec-local:
D
Daniel P. Berrange 已提交
190
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/cache/libvirt
R
Richard W.M. Jones 已提交
191

192
CLEANFILES = *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
193
DISTCLEANFILES = $(BUILT_SOURCES)