Makefile.am 5.0 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 13 14 15
	   -DBINDIR=\""$(libexecdir)"\" \
	   -DSBINDIR=\""$(sbindir)"\" \
	   -DSYSCONF_DIR="\"$(sysconfdir)\"" \
	   -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
D
Daniel P. Berrange 已提交
16
           -DLOCAL_STATE_DIR=\""$(localstatedir)"\" \
17 18 19
           -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
	   $(WARN_CFLAGS) \
	   $(LIBVIRT_FEATURES)
20
DEPS = libvirt.la
21
LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) libvirt.la ../gnulib/lib/libgnu.la
K
Karel Zak 已提交
22
VIRSH_LIBS = @VIRSH_LIBS@
D
Daniel Veillard 已提交
23

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


EXTRA_DIST = libvirt_sym.version $(conf_DATA)
29

30
lib_LTLIBRARIES = libvirt.la
31 32

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

68
SERVER_SOURCES =						\
69 70
		../qemud/remote_protocol.c ../qemud/remote_protocol.h

R
Richard W.M. Jones 已提交
71 72 73 74 75 76 77 78
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

79 80 81 82 83 84
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

85 86 87 88 89 90
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

91 92 93 94 95 96
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 已提交
97
endif
98 99


100
libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES)
101
libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) $(SELINUX_LIBS) \
102
		    @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
103 104 105
libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
                     -version-info @LIBVIRT_VERSION_INFO@ \
                    $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
106
		    @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
107
libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
108

109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
# 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 已提交
128
bin_PROGRAMS = virsh
129

J
Jim Meyering 已提交
130
virsh_SOURCES = virsh.c console.c console.h util-lib.c util-lib.h
131
virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
132
virsh_DEPENDENCIES = $(DEPS)
K
Karel Zak 已提交
133
virsh_LDADD = $(LDADDS) $(VIRSH_LIBS)
134
virsh_CFLAGS = $(COVERAGE_CFLAGS) $(READLINE_CFLAGS)
135

136
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
137
if WITH_LIBVIRTD
138 139 140 141 142 143
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 已提交
144
endif
145 146 147 148
else
EXTRA_DIST += parthelper.c
endif

149 150 151 152 153 154 155 156 157 158 159 160
cov: clean-cov
	for i in $(CLIENT_SOURCES); do			\
	  case $$i in *.c) ;; *) continue;; esac;	\
	  b=$$(basename $$i .c);			\
	  o_files=;					\
	  for i in '' _test; do				\
	    o="$(LV_LIBTOOL_OBJDIR)/libvirt$${i}_la-$$b.o";	\
	    test -f "$$o"				\
	      && o_files="$$o_files $$o";		\
	  done;						\
	  gcov -b -f $$o_files > $$b.cov;		\
	done
161 162 163 164 165

clean-cov:
	rm -f *.cov *.gcov

CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda