1 ## Copyright (C) 2005-2011 Red Hat, Inc.
2 ## See COPYING.LIB for the License of this software
5 -I../include -I$(top_srcdir)/include \
6 -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
8 -I$(top_srcdir)/src/util \
12 POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
15 libvirt_win_icon_16x16.ico \
16 libvirt_win_icon_32x32.ico \
17 libvirt_win_icon_48x48.ico \
18 libvirt_win_icon_64x64.ico \
23 virt-xml-validate.in \
24 virt-pki-validate.in \
25 virt-sanlock-cleanup.in \
26 virt-sanlock-cleanup.8 \
28 libvirt-guests.init.sh \
29 libvirt-guests.sysconf
31 bin_SCRIPTS = virt-xml-validate virt-pki-validate
35 sbin_SCRIPTS = virt-sanlock-cleanup
38 dist_man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1
40 dist_man8_MANS = virt-sanlock-cleanup.8
43 virt-xml-validate: virt-xml-validate.in Makefile
44 $(AM_V_GEN)sed -e 's,[@]SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \
45 || (rm $@ && exit 1) && chmod +x $@
47 virt-xml-validate.1: virt-xml-validate.in
48 $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
50 virt-pki-validate: virt-pki-validate.in Makefile
51 $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
52 || (rm $@ && exit 1) && chmod +x $@
54 virt-pki-validate.1: virt-pki-validate.in
55 $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
57 virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile
58 $(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' \
59 -e 's,[@]LOCALSTATEDIR@,$(localstatedir),' < $< > $@ \
60 || (rm $@ && exit 1) && chmod +x $@
62 virt-sanlock-cleanup.8: virt-sanlock-cleanup.in
63 $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
69 virsh_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
74 ../src/libvirt-qemu.la \
75 ../gnulib/lib/libgnu.la \
83 BUILT_SOURCES = virsh-net-edit.c virsh-pool-edit.c
85 virsh-net-edit.c: virsh.c Makefile.am
86 $(AM_V_GEN)rm -f $@-tmp && \
87 echo '/* Automatically generated from: $^ */' > $@-tmp && \
88 echo 'static bool' >> $@-tmp && \
89 awk '/^cmdEdit/, /^}/' $< \
90 | sed -e 's/domain/network/g' \
91 -e 's/Domain/Network/g' \
92 -e 's/cmdEdit/cmdNetworkEdit/g' \
93 -e 's/dom/network/g' \
94 -e 's/int flags.*/int flags = 0;/g' \
100 virsh-pool-edit.c: virsh.c Makefile.am
101 $(AM_V_GEN)rm -f $@-tmp && \
102 echo '/* Automatically generated from: $^ */' > $@-tmp && \
103 echo 'static bool' >> $@-tmp && \
104 awk '/^cmdEdit/, /^}/' $< \
105 | sed -e 's/domain/pool/g' \
106 -e 's/vshCommandOptDomain/vshCommandOptPool/g' \
107 -e 's/Domain %s/Pool %s/g' \
108 -e 's/(ctl, cmd, NULL);/(ctl, cmd, "pool", NULL);/' \
109 -e 's/Domain/StoragePool/g' \
110 -e 's/cmdEdit/cmdPoolEdit/g' \
111 -e 's/\(virStoragePoolDefineXML.*\));/\1, 0);/' \
113 -e 's/int flags.*/int flags = 0;/g' \
115 chmod a-w $@-tmp && \
121 virsh_LDADD += virsh_win_icon.$(OBJEXT)
123 # Before you edit virsh_win_icon.rc, please note the following
124 # limitations of the resource file format:
126 # (1) '..' is not permitted in the icon filename field.
127 # (2) '-' is not permitted in the icon filename field.
128 # (3) Comments are not permitted in the file.
130 # Windows appears to choose the first <= 32x32 icon it finds
131 # in the resource file. Therefore you should list the available
132 # icons from largest to smallest, and make sure that the 32x32
133 # icon is the most legible.
135 # Windows .ICO is a special MS-only format. GIMP and other
136 # tools can write it. However there are several variations,
137 # and Windows seems to do its own colour quantization. More
138 # information is needed in this area.
140 virsh_win_icon.$(OBJEXT): virsh_win_icon.rc
141 $(AM_V_GEN)$(WINDRES) \
142 --input-format rc --input $< \
143 --output-format coff --output $@
147 $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@
149 install-data-local: install-init
151 uninstall-local: uninstall-init
153 if LIBVIRT_INIT_SCRIPT_RED_HAT
154 install-init: libvirt-guests.init
155 mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
156 $(INSTALL_SCRIPT) libvirt-guests.init \
157 $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
158 mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
159 $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
160 $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
163 rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests \
164 $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
166 BUILT_SOURCES += libvirt-guests.init
168 libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
170 -e 's!\@PACKAGE\@!$(PACKAGE)!g' \
171 -e 's!\@bindir\@!$(bindir)!g' \
172 -e 's!\@localedir\@!$(localedir)!g' \
173 -e 's!\@localstatedir\@!$(localstatedir)!g' \
174 -e 's!\@sbindir\@!$(sbindir)!g' \
175 -e 's!\@sysconfdir\@!$(sysconfdir)!g' \
183 endif # LIBVIRT_INIT_SCRIPT_RED_HAT
186 CLEANFILES = $(bin_SCRIPTS)
187 CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
188 MAINTAINERCLEANFILES = $(dist_man1_MANS)
190 DISTCLEANFILES = $(BUILT_SOURCES)