Makefile.am 5.3 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
                capabilities.c capabilities.h			\
43
		xml.c xml.h					\
44
		event.c event.h					\
45
		xen_unified.c xen_unified.h			\
46
		xen_internal.c xen_internal.h			\
47
		xs_internal.c xs_internal.h			\
48
		xend_internal.c xend_internal.h			\
49
		stats_linux.c stats_linux.h			\
50
		sexpr.c sexpr.h					\
51
		virterror.c					\
52
		driver.h					\
D
Daniel Veillard 已提交
53
		proxy_internal.c proxy_internal.h		\
54
		conf.c conf.h                                   \
D
Daniel P. Berrange 已提交
55
		xm_internal.c xm_internal.h                     \
56
		remote_internal.c remote_internal.h		\
57 58 59 60
		bridge.c bridge.h				\
		iptables.c iptables.h				\
		uuid.c uuid.h					\
		qemu_driver.c qemu_driver.h			\
61 62
		qemu_conf.c qemu_conf.h				\
		openvz_conf.c openvz_conf.h			\
63
		openvz_driver.c openvz_driver.h			\
D
Daniel Veillard 已提交
64 65
		lxc_driver.c lxc_driver.h			\
		lxc_conf.c lxc_conf.h				\
R
Richard W.M. Jones 已提交
66
		lxc_container.c lxc_container.h			\
67
                nodeinfo.h nodeinfo.c                           \
68
		util.c util.h
69

70
SERVER_SOURCES =						\
71 72
		../qemud/remote_protocol.c ../qemud/remote_protocol.h

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

81 82 83 84 85 86
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

87 88 89 90 91 92
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

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


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

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

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

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

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

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

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