Makefile.am 4.8 KB
Newer Older
1

2 3 4 5 6 7 8 9 10
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

11
EXTRA_DIST = \
E
Eric Blake 已提交
12 13 14
	$(ICON_FILES)					\
	virt-xml-validate.in				\
	virt-pki-validate.in				\
15
	virsh.pod					\
16
	libvirt-guests.init.sh				\
17
	libvirt-guests.sysconf
18

19
bin_SCRIPTS = virt-xml-validate virt-pki-validate
20 21
bin_PROGRAMS = virsh

22
man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1
23

24 25

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

29
virt-xml-validate.1: virt-xml-validate
30
	$(AM_V_GEN)$(POD2MAN) $< $@
31

32
virt-pki-validate: virt-pki-validate.in Makefile
33 34
	$(AM_V_GEN)sed -e 's,@SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
	    || (rm $@ && exit 1) && chmod +x $@
35

36
virt-pki-validate.1: virt-pki-validate
37
	$(AM_V_GEN)$(POD2MAN) $< $@
38 39 40

virsh_SOURCES =							\
		console.c console.h				\
41
		../daemon/event.c ../daemon/event.h		\
42 43
		virsh.c

E
Eric Blake 已提交
44
virsh_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
45 46 47 48
virsh_LDADD =							\
		$(STATIC_BINARIES)				\
		$(WARN_CFLAGS)					\
		../src/libvirt.la				\
49
		../src/libvirt-qemu.la				\
50 51
		../gnulib/lib/libgnu.la				\
		$(VIRSH_LIBS)
E
Eric Blake 已提交
52
virsh_CFLAGS =							\
53
		-I$(top_srcdir)/gnulib/lib -I../gnulib/lib	\
54
		-I../include -I$(top_srcdir)/include		\
55 56
		-I$(top_srcdir)/src				\
		-I$(top_srcdir)/src/util			\
57
		-I$(top_srcdir)					\
58
		$(WARN_CFLAGS)					\
59 60 61 62 63 64
		$(COVERAGE_CFLAGS)				\
		$(LIBXML_CFLAGS)				\
		$(READLINE_CFLAGS)
BUILT_SOURCES = virsh-net-edit.c virsh-pool-edit.c

virsh-net-edit.c: virsh.c Makefile.am
65 66 67
	$(AM_V_GEN)rm -f $@-tmp && \
	echo '/* Automatically generated from: $^ */' > $@-tmp && \
	echo 'static int' >> $@-tmp && \
68 69 70 71 72 73
	awk '/^cmdEdit/, /^}/' $< \
	  | sed -e 's/domain/network/g' \
	      -e 's/Domain/Network/g' \
	      -e 's/cmdEdit/cmdNetworkEdit/g' \
	      -e 's/dom/network/g' \
	      -e 's/int flags.*/int flags = 0;/g' \
74 75 76
	>> $@-tmp && \
	chmod a-w $@-tmp && \
	rm -f $@ && \
77 78 79
	mv $@-tmp $@

virsh-pool-edit.c: virsh.c Makefile.am
80 81 82
	$(AM_V_GEN)rm -f $@-tmp && \
	echo '/* Automatically generated from: $^ */' > $@-tmp && \
	echo 'static int' >> $@-tmp && \
83 84 85 86 87 88 89 90 91 92
	awk '/^cmdEdit/, /^}/' $< \
	  | sed -e 's/domain/pool/g' \
	      -e 's/vshCommandOptDomain/vshCommandOptPool/g' \
	      -e 's/Domain %s/Pool %s/g' \
	      -e 's/(ctl, cmd, NULL);/(ctl, cmd, "pool", NULL);/' \
	      -e 's/Domain/StoragePool/g' \
	      -e 's/cmdEdit/cmdPoolEdit/g' \
	      -e 's/\(virStoragePoolDefineXML.*\));/\1, 0);/' \
	      -e 's/dom/pool/g' \
	      -e 's/int flags.*/int flags = 0;/g' \
93 94 95
	>> $@-tmp && \
	chmod a-w $@-tmp && \
	rm -f $@ && \
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
	mv $@-tmp $@


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
120
	$(AM_V_GEN)$(WINDRES) \
121 122 123 124 125
	  --input-format rc --input $< \
	  --output-format coff --output $@
endif

virsh.1: virsh.pod
126
	$(AM_V_GEN)$(POD2MAN) $< $@
127

128 129 130 131 132 133 134 135 136 137
install-data-local: install-init

uninstall-local: uninstall-init

if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init: libvirt-guests.init
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
	$(INSTALL_SCRIPT) libvirt-guests.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
138
	$(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
139 140 141 142 143 144 145 146
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests

uninstall-init:
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests

BUILT_SOURCES += libvirt-guests.init

147
libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
148
	$(AM_V_GEN)sed					\
149 150 151 152 153 154
	    -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'	\
155 156 157 158 159 160 161 162 163
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
else
install-init:
uninstall-init:
libvirt-guests.init:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT

164 165

CLEANFILES = $(bin_SCRIPTS) $(man1_MANS)
166
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
167

168
DISTCLEANFILES = $(BUILT_SOURCES)