Makefile.am 4.8 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			\
62
                nodeinfo.h nodeinfo.c                           \
63 64 65
		storage_conf.h storage_conf.c			\
		storage_driver.h storage_driver.c		\
		storage_backend.h storage_backend.c		\
66
		storage_backend_fs.h storage_backend_fs.c	\
67
		util.c util.h
68

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

72 73 74 75 76 77
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

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

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


91 92


93
libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES)
94
libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) $(SELINUX_LIBS) \
95
		    @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
96 97 98
libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
                     -version-info @LIBVIRT_VERSION_INFO@ \
                    $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
99
		    @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
100
libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
101

102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
# 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 已提交
121
bin_PROGRAMS = virsh
122

J
Jim Meyering 已提交
123
virsh_SOURCES = virsh.c console.c console.h util-lib.c util-lib.h
124
virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
125
virsh_DEPENDENCIES = $(DEPS)
K
Karel Zak 已提交
126
virsh_LDADD = $(LDADDS) $(VIRSH_LIBS)
127
virsh_CFLAGS = $(COVERAGE_CFLAGS) $(READLINE_CFLAGS)
128

129 130 131 132 133 134 135 136 137 138 139
if WITH_STORAGE_DISK
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)
else
EXTRA_DIST += parthelper.c
endif

140 141 142 143 144 145 146 147 148 149 150 151
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
152 153 154 155 156

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

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