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 116 117 118 119 120 121
		$(NULL)
#		virsh-nwfilter.c virsh-nwfilter.h		\
#		virsh-pool.c virsh-pool.h			\
#		virsh-secret.c virsh-secret.h			\
#		virsh-snapshot.c virsh-snapshot.h		\
#		virsh-volume.c virsh-volume.h			\
#
122

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

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
160
	$(AM_V_GEN)$(WINDRES) \
161 162 163 164 165
	  --input-format rc --input $< \
	  --output-format coff --output $@
endif

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

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

170
uninstall-local: uninstall-init uninstall-systemd
171

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

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

EXTRA_DIST += libvirt-guests.init.sh

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

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

192 193 194 195 196

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

202
libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
203
	$(AM_V_GEN)sed					\
204 205 206 207 208 209
	    -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'	\
210 211 212
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
213 214 215 216 217



EXTRA_DIST += libvirt-guests.service.in

218 219
SYSTEMD_UNIT_DIR = /lib/systemd/system

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

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

BUILT_SOURCES += libvirt-guests.service

232
else
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
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 $@
248

249

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

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