Makefile.am 6.4 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
	libvirt-guests.sysconf		\
	virsh-edit.c
30

E
Eric Blake 已提交
31 32
DISTCLEANFILES =

33
bin_SCRIPTS = virt-xml-validate virt-pki-validate
34
bin_PROGRAMS = virsh virt-host-validate
35

36 37
if HAVE_SANLOCK
sbin_SCRIPTS = virt-sanlock-cleanup
E
Eric Blake 已提交
38
DISTCLEANFILES += virt-sanlock-cleanup
39
endif
40

41 42 43 44 45
dist_man1_MANS = \
		virt-host-validate.1 \
		virt-pki-validate.1 \
		virt-xml-validate.1 \
		virsh.1
46 47 48
if HAVE_SANLOCK
dist_man8_MANS = virt-sanlock-cleanup.8
endif
49 50

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

54 55
virt-xml-validate.1: virt-xml-validate.in
	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
56

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

61 62
virt-pki-validate.1: virt-pki-validate.in
	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
63

64 65 66
virt-host-validate.1: virt-host-validate.c
	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@

67 68 69 70 71 72 73 74
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
	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@

75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
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)

97 98 99 100
virsh_SOURCES =							\
		console.c console.h				\
		virsh.c

E
Eric Blake 已提交
101
virsh_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
102 103 104 105
virsh_LDADD =							\
		$(STATIC_BINARIES)				\
		$(WARN_CFLAGS)					\
		../src/libvirt.la				\
106
		../src/libvirt-qemu.la				\
107
		../gnulib/lib/libgnu.la				\
108
		$(LIBXML_LIBS)					\
109
		$(VIRSH_LIBS)
E
Eric Blake 已提交
110
virsh_CFLAGS =							\
111
		$(WARN_CFLAGS)					\
112 113 114
		$(COVERAGE_CFLAGS)				\
		$(LIBXML_CFLAGS)				\
		$(READLINE_CFLAGS)
115
BUILT_SOURCES =
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137

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
138
	$(AM_V_GEN)$(WINDRES) \
139 140 141 142 143
	  --input-format rc --input $< \
	  --output-format coff --output $@
endif

virsh.1: virsh.pod
144
	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
145

146
install-data-local: install-init install-systemd
147

148
uninstall-local: uninstall-init uninstall-systemd
149

150
install-sysconfig:
151
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
152 153 154 155 156
	$(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
157
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
158 159 160

EXTRA_DIST += libvirt-guests.init.sh

161
install-initscript: libvirt-guests.init
162
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
163 164 165
	$(INSTALL_SCRIPT) libvirt-guests.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests

166
uninstall-initscript:
167
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
168
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d ||:
169

170 171 172 173 174

if LIBVIRT_INIT_SCRIPT_RED_HAT
BUILT_SOURCES += libvirt-guests.init
install-init: install-sysconfig install-initscript
uninstall-init: uninstall-sysconfig uninstall-initscript
175 176 177 178 179
else
install-init:
uninstall-init:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT

180
libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
181
	$(AM_V_GEN)sed					\
182 183 184 185 186 187
	    -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'	\
188 189 190
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
191 192 193 194 195



EXTRA_DIST += libvirt-guests.service.in

196 197
SYSTEMD_UNIT_DIR = /lib/systemd/system

198
if LIBVIRT_INIT_SCRIPT_SYSTEMD
199
install-systemd: libvirt-guests.service install-initscript install-sysconfig
200
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
201
	$(INSTALL_DATA) libvirt-guests.service \
202
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
203

204 205
uninstall-systemd: uninstall-initscript uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
206
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
207 208 209

BUILT_SOURCES += libvirt-guests.service

210
else
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
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 $@
226

227

228
CLEANFILES = $(bin_SCRIPTS)
229
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
230
MAINTAINERCLEANFILES = $(dist_man1_MANS)
231

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