Makefile.am 8.1 KB
Newer Older
1
## Copyright (C) 2005-2013 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
libexec_SCRIPTS = libvirt-guests.sh
45

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

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

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

64
virt-xml-validate.1: virt-xml-validate.in $(top_srcdir)/configure.ac
E
Eric Blake 已提交
65 66
	$(AM_V_GEN)$(POD2MAN) --name VIRT-XML-VALIDATE $< $(srcdir)/$@ \
	    && if grep 'POD ERROR' $(srcdir)/$@ ; then \
E
Eric Blake 已提交
67
		rm $(srcdir)/$@; exit 1; fi
68

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

73
virt-pki-validate.1: virt-pki-validate.in $(top_srcdir)/configure.ac
E
Eric Blake 已提交
74 75
	$(AM_V_GEN)$(POD2MAN) --name VIRT-PKI-VALIDATE $< $(srcdir)/$@ \
	    && if grep 'POD ERROR' $(srcdir)/$@ ; then \
E
Eric Blake 已提交
76
		rm $(srcdir)/$@; exit 1; fi
77

78
virt-host-validate.1: virt-host-validate.c $(top_srcdir)/configure.ac
E
Eric Blake 已提交
79 80
	$(AM_V_GEN)$(POD2MAN) --name VIRT-HOST-VALIDATE $< $(srcdir)/$@ \
	    && if grep 'POD ERROR' $(srcdir)/$@ ; then \
E
Eric Blake 已提交
81
		rm $(srcdir)/$@; exit 1; fi
82

83
virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile
84 85
	$(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \
	    -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \
86 87
	    || (rm $@ && exit 1) && chmod +x $@

88
virt-sanlock-cleanup.8: virt-sanlock-cleanup.in $(top_srcdir)/configure.ac
E
Eric Blake 已提交
89 90
	$(AM_V_GEN)$(POD2MAN) --name VIRT-SANLOCK-CLEANUP $< $(srcdir)/$@ \
	    && if grep 'POD ERROR' $(srcdir)/$@ ; then \
E
Eric Blake 已提交
91
		rm $(srcdir)/$@; exit 1; fi
92

93 94 95 96 97 98 99 100 101
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) \
D
Daniel P. Berrange 已提交
102
		$(PIE_LDFLAGS) \
D
Daniel P. Berrange 已提交
103
		$(RELRO_LDFLAGS) \
104 105 106 107 108 109 110 111 112 113
		$(COVERAGE_LDFLAGS) \
		$(NULL)

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

virt_host_validate_CFLAGS = \
		$(WARN_CFLAGS)					\
D
Daniel P. Berrange 已提交
114
		$(PIE_CFLAGS)					\
115 116 117
		$(COVERAGE_CFLAGS)				\
		$(NULL)

118 119
virsh_SOURCES =							\
		console.c console.h				\
E
Eric Blake 已提交
120
		virsh.c virsh.h					\
E
Eric Blake 已提交
121
		virsh-domain.c virsh-domain.h			\
122
		virsh-domain-monitor.c virsh-domain-monitor.h	\
E
Eric Blake 已提交
123
		virsh-host.c virsh-host.h			\
E
Eric Blake 已提交
124
		virsh-interface.c virsh-interface.h		\
E
Eric Blake 已提交
125
		virsh-network.c virsh-network.h			\
E
Eric Blake 已提交
126
		virsh-nodedev.c virsh-nodedev.h			\
E
Eric Blake 已提交
127
		virsh-nwfilter.c virsh-nwfilter.h		\
E
Eric Blake 已提交
128
		virsh-pool.c virsh-pool.h			\
E
Eric Blake 已提交
129
		virsh-secret.c virsh-secret.h			\
E
Eric Blake 已提交
130
		virsh-snapshot.c virsh-snapshot.h		\
E
Eric Blake 已提交
131
		virsh-volume.c virsh-volume.h			\
E
Eric Blake 已提交
132
		$(NULL)
133

E
Eric Blake 已提交
134
virsh_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS)
135 136
virsh_LDADD =							\
		$(STATIC_BINARIES)				\
D
Daniel P. Berrange 已提交
137 138
		$(WARN_LDFLAGS)					\
		$(PIE_LDFLAGS)					\
D
Daniel P. Berrange 已提交
139
		$(RELRO_LDFLAGS) \
140
		../src/libvirt.la				\
141
		../src/libvirt-lxc.la				\
142
		../src/libvirt-qemu.la				\
143
		../gnulib/lib/libgnu.la				\
144
		$(LIBXML_LIBS)					\
145
		$(VIRSH_LIBS)
E
Eric Blake 已提交
146
virsh_CFLAGS =							\
147
		$(WARN_CFLAGS)					\
D
Daniel P. Berrange 已提交
148
		$(PIE_CFLAGS)					\
149 150 151
		$(COVERAGE_CFLAGS)				\
		$(LIBXML_CFLAGS)				\
		$(READLINE_CFLAGS)
152
BUILT_SOURCES =
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174

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
175
	$(AM_V_GEN)$(WINDRES) \
176 177 178 179
	  --input-format rc --input $< \
	  --output-format coff --output $@
endif

180
virsh.1: virsh.pod $(top_srcdir)/configure.ac
E
Eric Blake 已提交
181 182
	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@ \
	    && if grep 'POD ERROR' $(srcdir)/$@ ; then \
E
Eric Blake 已提交
183
		rm $(srcdir)/$@; exit 1; fi
184

185
install-data-local: install-init install-systemd
186

187
uninstall-local: uninstall-init uninstall-systemd
188

189
install-sysconfig:
190
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
191 192 193 194 195
	$(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
196
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
197

198
EXTRA_DIST += libvirt-guests.sh.in libvirt-guests.init.in
199

200
install-initscript: libvirt-guests.init
201
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
202 203 204
	$(INSTALL_SCRIPT) libvirt-guests.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests

205
uninstall-initscript:
206
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
207
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d ||:
208

209 210 211 212 213

if LIBVIRT_INIT_SCRIPT_RED_HAT
BUILT_SOURCES += libvirt-guests.init
install-init: install-sysconfig install-initscript
uninstall-init: uninstall-sysconfig uninstall-initscript
214 215 216 217 218
else
install-init:
uninstall-init:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT

219
libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status
220 221 222 223 224 225 226 227 228
	$(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 &&					\
229
	    mv $@-t $@
230
BUILT_SOURCES += libvirt-guests.sh
231

232 233
libvirt-guests.init: libvirt-guests.init.in libvirt-guests.sh
	$(AM_V_GEN)sed \
234
		-e 's|[@]libexecdir[@]|$(libexecdir)|g' \
235 236 237
	< $< > $@-t && \
	chmod a+x $@-t && \
	mv $@-t $@
238 239 240


EXTRA_DIST += libvirt-guests.service.in
241 242
SYSTEMD_UNIT_DIR = /lib/systemd/system

243
if LIBVIRT_INIT_SCRIPT_SYSTEMD
244
install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh
245
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
246
	$(INSTALL_DATA) libvirt-guests.service \
247
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
248

249
uninstall-systemd: uninstall-sysconfig
250
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
251
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
252 253 254

BUILT_SOURCES += libvirt-guests.service

255
else
256 257 258 259 260
install-systemd:
uninstall-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD

libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status
261 262 263 264 265 266 267 268 269
	$(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'		\
	    -e 's|[@]libexecdir[@]|$(libexecdir)|g'		\
	    < $< > $@-t &&					\
270
	    mv $@-t $@
271

272

273
CLEANFILES = $(bin_SCRIPTS)
274
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
275
MAINTAINERCLEANFILES = $(dist_man1_MANS)
276

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