Makefile.am 7.2 KB
Newer Older
1
## Copyright (C) 2005-2012 Red Hat, Inc.
2
## See COPYING.LIB for the License of this software
3

4
INCLUDES = \
5 6 7 8 9
	-I$(top_builddir)/include -I$(top_srcdir)/include	\
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib	\
	-I$(top_builddir)/src -I$(top_srcdir)/src		\
	-I$(top_srcdir)/src/util				\
	-I$(top_srcdir)						\
10 11
	$(GETTEXT_CPPFLAGS)

12 13 14 15 16 17 18 19 20
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"

ICON_FILES = \
	libvirt_win_icon_16x16.ico \
	libvirt_win_icon_32x32.ico \
	libvirt_win_icon_48x48.ico \
	libvirt_win_icon_64x64.ico \
	virsh_win_icon.rc

21
EXTRA_DIST = \
E
Eric Blake 已提交
22 23 24
	$(ICON_FILES)					\
	virt-xml-validate.in				\
	virt-pki-validate.in				\
25
	virt-sanlock-cleanup.in				\
E
Eric Blake 已提交
26
	virt-sanlock-cleanup.8				\
27
	virsh.pod					\
28 29 30 31 32 33 34 35 36 37 38
	libvirt-guests.sysconf				\
	virsh-edit.c					\
	virsh-domain.c					\
	virsh-domain-monitor.c				\
	virsh-host.c virsh-interface.c			\
	virsh-network.c virsh-nodedev.c			\
	virsh-nwfilter.c virsh-pool.c			\
	virsh-secret.c virsh-snapshot.c			\
	virsh-volume.c


39

E
Eric Blake 已提交
40 41
DISTCLEANFILES =

42
bin_SCRIPTS = virt-xml-validate virt-pki-validate
43
bin_PROGRAMS = virsh virt-host-validate
44

45 46
if HAVE_SANLOCK
sbin_SCRIPTS = virt-sanlock-cleanup
E
Eric Blake 已提交
47
DISTCLEANFILES += virt-sanlock-cleanup
48
endif
49

50 51 52 53 54
dist_man1_MANS = \
		virt-host-validate.1 \
		virt-pki-validate.1 \
		virt-xml-validate.1 \
		virsh.1
55 56 57
if HAVE_SANLOCK
dist_man8_MANS = virt-sanlock-cleanup.8
endif
58 59

virt-xml-validate: virt-xml-validate.in Makefile
60
	$(AM_V_GEN)sed -e 's,[@]SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \
61
	    || (rm $@ && exit 1) && chmod +x $@
62

63
virt-xml-validate.1: virt-xml-validate.in
64
	$(AM_V_GEN)$(POD2MAN) --name VIRT-XML-VALIDATE $< $(srcdir)/$@
65

66
virt-pki-validate: virt-pki-validate.in Makefile
67
	$(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
68
	    || (rm $@ && exit 1) && chmod +x $@
69

70
virt-pki-validate.1: virt-pki-validate.in
71
	$(AM_V_GEN)$(POD2MAN) --name VIRT-PKI-VALIDATE $< $(srcdir)/$@
72

73
virt-host-validate.1: virt-host-validate.c
74
	$(AM_V_GEN)$(POD2MAN) --name VIRT-HOST-VALIDATE $< $(srcdir)/$@
75

76 77 78 79 80 81
virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile
	$(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' \
	    -e 's,[@]LOCALSTATEDIR@,$(localstatedir),' < $< > $@ \
	    || (rm $@ && exit 1) && chmod +x $@

virt-sanlock-cleanup.8: virt-sanlock-cleanup.in
82
	$(AM_V_GEN)$(POD2MAN) --name VIRT-SANLOCK-CLEANUP $< $(srcdir)/$@
83

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
virt_host_validate_SOURCES = \
		virt-host-validate.c \
		virt-host-validate-common.c virt-host-validate-common.h \
		virt-host-validate-qemu.c virt-host-validate-qemu.h \
		virt-host-validate-lxc.c virt-host-validate-lxc.h \
		$(NULL)

virt_host_validate_LDFLAGS = \
		$(WARN_LDFLAGS) \
		$(COVERAGE_LDFLAGS) \
		$(NULL)

virt_host_validate_LDADD = \
		../src/libvirt.la				\
		../gnulib/lib/libgnu.la				\
		$(NULL)

virt_host_validate_CFLAGS = \
		$(WARN_CFLAGS)					\
		$(COVERAGE_CFLAGS)				\
		$(NULL)

106 107
virsh_SOURCES =							\
		console.c console.h				\
E
Eric Blake 已提交
108
		virsh.c virsh.h					\
E
Eric Blake 已提交
109
		virsh-domain.c virsh-domain.h			\
110
		virsh-domain-monitor.c virsh-domain-monitor.h	\
E
Eric Blake 已提交
111
		virsh-host.c virsh-host.h			\
E
Eric Blake 已提交
112
		virsh-interface.c virsh-interface.h		\
E
Eric Blake 已提交
113
		virsh-network.c virsh-network.h			\
E
Eric Blake 已提交
114
		virsh-nodedev.c virsh-nodedev.h			\
E
Eric Blake 已提交
115
		virsh-nwfilter.c virsh-nwfilter.h		\
E
Eric Blake 已提交
116
		virsh-pool.c virsh-pool.h			\
E
Eric Blake 已提交
117
		virsh-secret.c virsh-secret.h			\
E
Eric Blake 已提交
118
		virsh-snapshot.c virsh-snapshot.h		\
E
Eric Blake 已提交
119
		virsh-volume.c virsh-volume.h			\
E
Eric Blake 已提交
120
		$(NULL)
121

E
Eric Blake 已提交
122
virsh_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
123 124 125 126
virsh_LDADD =							\
		$(STATIC_BINARIES)				\
		$(WARN_CFLAGS)					\
		../src/libvirt.la				\
127
		../src/libvirt-qemu.la				\
128
		../gnulib/lib/libgnu.la				\
129
		$(LIBXML_LIBS)					\
130
		$(VIRSH_LIBS)
E
Eric Blake 已提交
131
virsh_CFLAGS =							\
132
		$(WARN_CFLAGS)					\
133 134 135
		$(COVERAGE_CFLAGS)				\
		$(LIBXML_CFLAGS)				\
		$(READLINE_CFLAGS)
136
BUILT_SOURCES =
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158

if WITH_WIN_ICON
virsh_LDADD += virsh_win_icon.$(OBJEXT)

# Before you edit virsh_win_icon.rc, please note the following
# limitations of the resource file format:
#
# (1) '..' is not permitted in the icon filename field.
# (2) '-' is not permitted in the icon filename field.
# (3) Comments are not permitted in the file.
#
# Windows appears to choose the first <= 32x32 icon it finds
# in the resource file.  Therefore you should list the available
# icons from largest to smallest, and make sure that the 32x32
# icon is the most legible.
#
# Windows .ICO is a special MS-only format.  GIMP and other
# tools can write it.  However there are several variations,
# and Windows seems to do its own colour quantization.  More
# information is needed in this area.

virsh_win_icon.$(OBJEXT): virsh_win_icon.rc
159
	$(AM_V_GEN)$(WINDRES) \
160 161 162 163 164
	  --input-format rc --input $< \
	  --output-format coff --output $@
endif

virsh.1: virsh.pod
165
	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
166

167
install-data-local: install-init install-systemd
168

169
uninstall-local: uninstall-init uninstall-systemd
170

171
install-sysconfig:
172
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
173 174 175 176 177
	$(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
178
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
179 180 181

EXTRA_DIST += libvirt-guests.init.sh

182
install-initscript: libvirt-guests.init
183
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
184 185 186
	$(INSTALL_SCRIPT) libvirt-guests.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests

187
uninstall-initscript:
188
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
189
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d ||:
190

191 192 193 194 195

if LIBVIRT_INIT_SCRIPT_RED_HAT
BUILT_SOURCES += libvirt-guests.init
install-init: install-sysconfig install-initscript
uninstall-init: uninstall-sysconfig uninstall-initscript
196 197 198 199 200
else
install-init:
uninstall-init:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT

201
libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
202
	$(AM_V_GEN)sed					\
203 204 205 206 207 208
	    -e 's!\@PACKAGE\@!$(PACKAGE)!g'		\
	    -e 's!\@bindir\@!$(bindir)!g'		\
	    -e 's!\@localedir\@!$(localedir)!g'		\
	    -e 's!\@localstatedir\@!$(localstatedir)!g'	\
	    -e 's!\@sbindir\@!$(sbindir)!g'		\
	    -e 's!\@sysconfdir\@!$(sysconfdir)!g'	\
209 210 211
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
212 213 214 215 216



EXTRA_DIST += libvirt-guests.service.in

217 218
SYSTEMD_UNIT_DIR = /lib/systemd/system

219
if LIBVIRT_INIT_SCRIPT_SYSTEMD
220
install-systemd: libvirt-guests.service install-initscript install-sysconfig
221
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
222
	$(INSTALL_DATA) libvirt-guests.service \
223
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
224

225 226
uninstall-systemd: uninstall-initscript uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
227
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
228 229 230

BUILT_SOURCES += libvirt-guests.service

231
else
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
install-systemd:
uninstall-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD

libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed					\
	    -e 's!\@PACKAGE\@!$(PACKAGE)!g'		\
	    -e 's!\@bindir\@!$(bindir)!g'		\
	    -e 's!\@localedir\@!$(localedir)!g'		\
	    -e 's!\@localstatedir\@!$(localstatedir)!g'	\
	    -e 's!\@sbindir\@!$(sbindir)!g'		\
	    -e 's!\@sysconfdir\@!$(sysconfdir)!g'	\
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
247

248

249
CLEANFILES = $(bin_SCRIPTS)
250
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
251
MAINTAINERCLEANFILES = $(dist_man1_MANS)
252

E
Eric Blake 已提交
253
DISTCLEANFILES += $(BUILT_SOURCES)