Makefile.am 14.2 KB
Newer Older
1
## Process this file with automake to produce Makefile.in
2

3
## Copyright (C) 2005-2016 Red Hat, Inc.
E
Eric Blake 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library.  If not, see
## <http://www.gnu.org/licenses/>.
18

19
HTML_DIR = $(docdir)/html
20

A
Andrea Bolognani 已提交
21 22 23
modules = \
	libvirt-common \
	libvirt-domain \
24
	libvirt-domain-checkpoint \
A
Andrea Bolognani 已提交
25 26 27 28 29 30 31 32 33 34 35 36 37
	libvirt-domain-snapshot \
	libvirt-event \
	libvirt-host \
	libvirt-interface \
	libvirt-network \
	libvirt-nodedev \
	libvirt-nwfilter \
	libvirt-secret \
	libvirt-storage \
	libvirt-stream \
	virterror \
	$(NULL)

38 39 40 41
modules_admin = libvirt-admin
modules_qemu = libvirt-qemu
modules_lxc = libvirt-lxc

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
all: vpathhack

# This hack enables us to view the web pages
# from within the uninstalled build tree
vpathhack:
	@for dir in fonts js logos; \
	do \
	  test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \
	done
	@for file in $(css); \
	do \
	  test -e $$file || ln -s $(srcdir)/$$file $$file ; \
	done

clean-local:
	for dir in fonts js logos; \
	do \
	  rm -f $$dir ; \
	done
	for file in $(css); \
	do \
	  rm -f $$file ; \
	done

66 67
apihtml = \
  html/index.html \
68 69 70
  $(apihtml_generated)

apihtml_generated = \
A
Andrea Bolognani 已提交
71 72
	$(addprefix html/libvirt-,$(addsuffix .html,$(modules))) \
	$(NULL)
J
Jim Meyering 已提交
73

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
apiadminhtml = \
  html/index-admin.html \
  $(apiadminhtml_generated)

apiadminhtml_generated = \
	$(addprefix html/libvirt-,$(addsuffix .html,$(modules_admin))) \
	$(NULL)

apiqemuhtml = \
  html/index-qemu.html \
  $(apiqemuhtml_generated)

apiqemuhtml_generated = \
	$(addprefix html/libvirt-,$(addsuffix .html,$(modules_qemu))) \
	$(NULL)

apilxchtml = \
  html/index-lxc.html \
  $(apilxchtml_generated)

apilxchtml_generated = \
	$(addprefix html/libvirt-,$(addsuffix .html,$(modules_lxc))) \
	$(NULL)

98 99 100 101
apipng = \
  html/left.png \
  html/up.png \
  html/home.png \
102
  html/right.png
J
Jim Meyering 已提交
103

104
apirefdir = $(HTML_DIR)/html
105
apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml) $(apipng)
106

107
css = \
108 109
  generic.css \
  libvirt.css \
110
  mobile.css \
111 112
  main.css

113
javascript = \
114
  js/main.js \
115
  $(NULL)
116

117 118 119
javascriptdir = $(HTML_DIR)/js
javascript_DATA = $(javascript)

120 121 122 123 124 125 126 127 128 129 130 131 132 133
fonts = \
  fonts/LICENSE.md \
  fonts/stylesheet.css \
  fonts/overpass-bold-italic.woff \
  fonts/overpass-bold.woff \
  fonts/overpass-italic.woff \
  fonts/overpass-light-italic.woff \
  fonts/overpass-light.woff \
  fonts/overpass-mono-bold.woff \
  fonts/overpass-mono-light.woff \
  fonts/overpass-mono-regular.woff \
  fonts/overpass-mono-semibold.woff \
  fonts/overpass-regular.woff

134 135 136
fontsdir = $(HTML_DIR)/fonts
fonts_DATA = $(fonts)

137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
logofiles = \
  logos/logo-base.svg \
  logos/logo-square.svg \
  logos/logo-square-powered.svg \
  logos/logo-banner-dark.svg \
  logos/logo-banner-light.svg \
  logos/logo-square-96.png \
  logos/logo-square-128.png \
  logos/logo-square-192.png \
  logos/logo-square-256.png \
  logos/logo-square-powered-96.png \
  logos/logo-square-powered-128.png \
  logos/logo-square-powered-192.png \
  logos/logo-square-powered-256.png \
  logos/logo-banner-dark-256.png \
  logos/logo-banner-dark-800.png \
  logos/logo-banner-light-256.png \
  logos/logo-banner-light-800.png

156 157 158
logofilesdir = $(HTML_DIR)/logos
logofiles_DATA = $(logofiles)

159 160
png = \
  32favicon.png \
D
Daniel Veillard 已提交
161 162 163
  libvirt-daemon-arch.png \
  libvirt-driver-arch.png \
  libvirt-object-model.png \
164 165 166 167 168
  migration-managed-direct.png \
  migration-managed-p2p.png \
  migration-native.png \
  migration-tunnel.png \
  migration-unmanaged-direct.png
169

J
Jim Meyering 已提交
170 171
gif = \
  architecture.gif \
172
  node.gif
J
Jim Meyering 已提交
173

174 175
internals_html_in = \
  $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
176 177 178 179
internals_rst = \
  $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.rst))
internals_rst_html_in = \
  $(internals_rst:%.rst=%.html.in)
180 181 182
internals_html = \
  $(internals_html_in:%.html.in=%.html) \
  $(internals_rst_html_in:%.html.in=%.html)
183

184 185 186
internalsdir = $(HTML_DIR)/internals
internals_DATA = $(internals_html)

187 188
kbase_html_in = \
  $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.html.in))
189 190 191 192 193 194 195
kbase_rst = \
  $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.rst))
kbase_rst_html_in = \
  $(kbase_rst:%.rst=%.html.in)
kbase_html = \
  $(kbase_html_in:%.html.in=%.html) \
  $(kbase_rst_html_in:%.html.in=%.html)
196

197 198 199
kbasedir = $(HTML_DIR)/kbase
kbase_DATA = $(kbase_html)

200 201 202 203
# Sync with src/util/
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum
KEYNAMES = linux osx win32

204 205 206 207
manpages_rst = \
  manpages/index.rst \
  $(NULL)
manpages1_rst = \
208
  manpages/virt-pki-validate.rst \
209
  manpages/virt-xml-validate.rst \
210
  manpages/virt-admin.rst \
211
  manpages/virsh.rst \
212 213
  $(NULL)
manpages7_rst = \
214 215
  $(KEYCODES:%=manpages/virkeycode-%.rst) \
  $(KEYNAMES:%=manpages/virkeyname-%.rst) \
216
  $(NULL)
217
manpages8_rst = $(NULL)
218 219 220 221 222
manpages_rst += \
  $(manpages1_rst) \
  $(manpages7_rst) \
  $(manpages8_rst) \
  $(NULL)
223 224 225
if WITH_LIBVIRTD
manpages8_rst += \
  manpages/libvirtd.rst \
226
  manpages/virtlockd.rst \
227
  manpages/virtlogd.rst \
228 229 230 231
  $(NULL)
else ! WITH_LIBVIRTD
manpages_rst += \
  manpages/libvirtd.rst \
232
  manpages/virtlockd.rst \
233
  manpages/virtlogd.rst \
234 235
  $(NULL)
endif ! WITH_LIBVIRTD
236 237 238 239 240
if WITH_HOST_VALIDATE
  manpages1_rst += manpages/virt-host-validate.rst
else ! WITH_HOST_VALIDATE
  manpages_rst += manpages/virt-host-validate.rst
endif ! WITH_HOST_VALIDATE
241 242 243 244 245
if WITH_LOGIN_SHELL
  manpages1_rst += manpages/virt-login-shell.rst
else ! WITH_LOGIN_SHELL
  manpages_rst += manpages/virt-login-shell.rst
endif ! WITH_LOGIN_SHELL
246 247 248 249 250
if WITH_SANLOCK
  manpages8_rst += manpages/virt-sanlock-cleanup.rst
else ! WITH_SANLOCK
  manpages_rst += manpages/virt-sanlock-cleanup.rst
endif ! WITH_SANLOCK
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
manpages_rst_html_in = \
  $(manpages_rst:%.rst=%.html.in)
manpages_html = \
  $(manpages_rst_html_in:%.html.in=%.html)

man1_MANS = $(manpages1_rst:%.rst=%.1)
man7_MANS = $(manpages7_rst:%.rst=%.7)
man8_MANS = $(manpages8_rst:%.rst=%.8)

%.1: %.rst
	$(AM_V_GEN)$(MKDIR_P) `dirname $@` && \
	   grep -v '^\.\. contents::' < $< | \
	   sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \
	       -e 's|RUNSTATEDIR|$(runstatedir)|g' | \
	   $(RST2MAN) > $@

%.7: %.rst
	$(AM_V_GEN)$(MKDIR_P) `dirname $@` && \
	   grep -v '^\.\. contents::' < $< | \
	   sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \
	       -e 's|RUNSTATEDIR|$(runstatedir)|g' | \
	   $(RST2MAN) > $@

%.8: %.rst
	$(AM_V_GEN)$(MKDIR_P) `dirname $@` && \
	   grep -v '^\.\. contents::' < $< | \
	   sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \
	       -e 's|RUNSTATEDIR|$(runstatedir)|g' | \
	   $(RST2MAN) > $@

281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
manpages/virkeycode-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \
		$(top_srcdir)/src/keycodemapdb/tools/keymap-gen Makefile.am
	$(AM_V_GEN)export NAME=`echo $@ | \
		sed -e 's,manpages/virkeycode-,,' -e 's,\.rst,,'` && \
		$(MKDIR_P) manpages/ && \
		$(RUNUTF8) $(PYTHON) $(top_srcdir)/src/keycodemapdb/tools/keymap-gen \
		code-docs \
		--lang rst \
		--title "virkeycode-$$NAME" \
		--subtitle "Key code values for $$NAME" \
		$(top_srcdir)/src/keycodemapdb/data/keymaps.csv $$NAME > $@

manpages/virkeyname-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \
		$(top_srcdir)/src/keycodemapdb/tools/keymap-gen Makefile.am
	$(AM_V_GEN)export NAME=`echo $@ | \
		sed -e 's,manpages/virkeyname-,,' -e 's,\.rst,,'` && \
		$(MKDIR_P) manpages/ && \
		$(RUNUTF8) $(PYTHON) $(top_srcdir)/src/keycodemapdb/tools/keymap-gen \
		name-docs \
		--lang rst \
		--title "virkeyname-$$NAME" \
		--subtitle "Key name values for $$NAME" \
		$(top_srcdir)/src/keycodemapdb/data/keymaps.csv $$NAME > $@
304 305 306 307

manpagesdir = $(HTML_DIR)/manpages
manpages_DATA = $(manpages_html)

308
# Generate hvsupport.html and news.html first, since they take one extra step.
309
dot_html_generated_in = \
310
  hvsupport.html.in \
311 312
  news.html.in
dot_html_in = \
313
  $(notdir $(wildcard $(srcdir)/*.html.in))
314 315 316 317
dot_rst = \
  $(notdir $(wildcard $(srcdir)/*.rst))
dot_rst_html_in = \
  $(dot_rst:%.rst=%.html)
318 319
dot_html = \
  $(dot_html_generated_in:%.html.in=%.html) \
320 321
  $(dot_html_in:%.html.in=%.html) \
  $(dot_rst_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
322

323 324 325
htmldir = $(HTML_DIR)
html_DATA = $(css) $(png) $(gif) $(dot_html)

326
apidir = $(pkgdatadir)/api
327 328 329
api_DATA = \
       libvirt-api.xml \
       libvirt-qemu-api.xml \
330 331
       libvirt-lxc-api.xml \
       libvirt-admin-api.xml
332

333
fig = \
D
Daniel Veillard 已提交
334 335
  libvirt-daemon-arch.fig \
  libvirt-driver-arch.fig \
336 337 338 339 340 341
  libvirt-object-model.fig \
  migration-managed-direct.fig \
  migration-managed-p2p.fig \
  migration-native.fig \
  migration-tunnel.fig \
  migration-unmanaged-direct.fig
342

343
schemadir = $(pkgdatadir)/schemas
M
Michal Privoznik 已提交
344
schema_DATA = $(wildcard $(srcdir)/schemas/*.rng)
345

346
EXTRA_DIST= \
347
  site.xsl subsite.xsl newapi.xsl page.xsl \
348
  wrapstring.xsl \
349
  $(dot_html_in) $(dot_rst) $(gif) $(apipng) \
350
  $(fig) $(png) $(css) \
351
  $(javascript) $(logofiles) \
352 353
  $(internals_html_in) $(internals_rst) $(fonts) \
  $(kbase_html_in) $(kbase_rst) \
354
  $(manpages_rst) \
355
  aclperms.htmlinc \
356
  $(schema_DATA)
J
Jim Meyering 已提交
357

358
acl_generated = aclperms.htmlinc
359

360
aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \
361 362
        $(top_srcdir)/scripts/genaclperms.py Makefile.am
	$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/genaclperms.py $< > $@
363

364 365 366
CLEANFILES = \
  $(dot_html) \
  $(apihtml) \
367 368 369
  $(apiadminhtml) \
  $(apiqemuhtml) \
  $(apilxchtml) \
370 371
  $(internals_html) \
  $(kbase_html) \
372 373 374
  $(manpages_html) \
  $(man1_MANS) \
  $(man7_MANS) \
375
  $(manpages7_rst) \
376
  $(man8_MANS) \
377
  $(api_DATA) \
378 379
  $(dot_html_generated_in) \
  aclperms.htmlinc
380

381 382
timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \
		   then \
383
		     date -u --date="@$$SOURCE_DATE_EPOCH"; \
384
		   else \
385
		     date -u; \
386 387
		   fi)"

388
hvsupport.html: hvsupport.html.in
389

390
hvsupport.html.in: $(top_srcdir)/scripts/hvsupport.py $(api_DATA) \
M
Michal Privoznik 已提交
391 392 393
		$(top_srcdir)/src/libvirt_public.syms \
	$(top_srcdir)/src/libvirt_qemu.syms $(top_srcdir)/src/libvirt_lxc.syms \
	$(top_srcdir)/src/driver.h
394 395
	$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/hvsupport.py \
		$(top_srcdir) $(top_builddir) > $@ || { rm $@ && exit 1; }
396

397 398 399
news.html.in: \
	  $(srcdir)/news.xml \
	  $(srcdir)/news-html.xsl
400
	$(AM_V_GEN)$(XSLTPROC) --nonet \
401 402
	    $(srcdir)/news-html.xsl \
	    $(srcdir)/news.xml \
J
Ján Tomko 已提交
403 404
	  >$@ \
	    || { rm -f $@; exit 1; };
405 406
EXTRA_DIST += \
	$(srcdir)/news.xml \
P
Peter Krempa 已提交
407
	$(srcdir)/news.rng \
408 409
	$(srcdir)/news-html.xsl

D
Daniel Veillard 已提交
410 411 412
%.png: %.fig
	convert -rotate 90 $< $@

413 414 415 416 417 418 419
manpages/%.html.in: manpages/%.rst
	$(AM_V_GEN)$(MKDIR_P) `dirname $@` && \
	 grep -v '^:Manual ' < $< | \
	  sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \
	     -e 's|RUNSTATEDIR|$(runstatedir)|g' | \
	  $(RST2HTML) > $@

420 421 422 423
%.html.in: %.rst
	$(AM_V_GEN)$(MKDIR_P) `dirname $@` && \
	  $(RST2HTML) $< > $@

424
%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \
425
		$(acl_generated)
426
	$(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \
427 428 429 430 431 432 433 434
	  dir=`dirname $@` ; \
	  if test "$$dir" = "."; \
	  then \
	    style=site.xsl; \
	  else \
	    $(MKDIR_P) $$dir; \
	    style=subsite.xsl; \
	  fi; \
435
	  $(XSLTPROC) --stringparam pagename $$name \
436
	    --stringparam builddir '$(abs_top_builddir)' \
437
	    --stringparam timestamp $(timestamp) --nonet \
438
	    $(top_srcdir)/docs/$$style $< > $@ \
439
	    || { rm $@ && exit 1; }
440 441

%.html: %.html.tmp
442 443
	$(AM_V_GEN)$(XMLLINT) --nonet --format $< > $@ \
	  || { rm $@ && exit 1; }
444

445
$(apihtml_generated): html/index.html
446 447 448
$(apiadminhtml_generated): html/index-admin.html
$(apiqemuhtml_generated): html/index-qemu.html
$(apilxchtml_generated): html/index-lxc.html
449

450
html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
451
	$(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \
452
	  --stringparam builddir '$(abs_top_builddir)' \
453
	  --stringparam timestamp $(timestamp) \
454
	  $(srcdir)/newapi.xsl libvirt-api.xml
455

456 457 458 459 460
html/index-%.html: libvirt-%-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
	$(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \
	  --stringparam builddir '$(abs_top_builddir)' \
	  --stringparam timestamp $(timestamp) \
	  --stringparam indexfile $(@:html/%=%) \
461 462 463 464 465 466
	  $(srcdir)/newapi.xsl $<

check-html:
	$(XMLLINT) --nonet --noout html/*.html

check-local: check-html
467

468
python_generated_files = \
469 470 471 472
		html/libvirt-libvirt-lxc.html \
		html/libvirt-libvirt-qemu.html \
		html/libvirt-libvirt-admin.html \
		html/libvirt-virterror.html \
473
		$(api_DATA) \
474
		$(NULL)
475

476
APIBUILD=$(top_srcdir)/scripts/apibuild.py
477 478
APIBUILD_STAMP=apibuild.py.stamp
CLEANFILES += $(APIBUILD_STAMP)
479 480 481

$(python_generated_files): $(APIBUILD_STAMP)

482
$(APIBUILD_STAMP): $(top_srcdir)/scripts/apibuild.py \
483 484
		$(top_srcdir)/include/libvirt/libvirt.h \
		$(top_srcdir)/include/libvirt/libvirt-common.h.in \
485
		$(top_srcdir)/include/libvirt/libvirt-domain-checkpoint.h \
M
Michal Privoznik 已提交
486 487 488 489 490 491 492 493 494 495 496 497 498
		$(top_srcdir)/include/libvirt/libvirt-domain-snapshot.h \
		$(top_srcdir)/include/libvirt/libvirt-domain.h \
		$(top_srcdir)/include/libvirt/libvirt-event.h \
		$(top_srcdir)/include/libvirt/libvirt-host.h \
		$(top_srcdir)/include/libvirt/libvirt-interface.h \
		$(top_srcdir)/include/libvirt/libvirt-network.h \
		$(top_srcdir)/include/libvirt/libvirt-nodedev.h \
		$(top_srcdir)/include/libvirt/libvirt-nwfilter.h \
		$(top_srcdir)/include/libvirt/libvirt-secret.h \
		$(top_srcdir)/include/libvirt/libvirt-storage.h \
		$(top_srcdir)/include/libvirt/libvirt-stream.h \
		$(top_srcdir)/include/libvirt/libvirt-lxc.h \
		$(top_srcdir)/include/libvirt/libvirt-qemu.h \
499
		$(top_srcdir)/include/libvirt/libvirt-admin.h \
M
Michal Privoznik 已提交
500 501
		$(top_srcdir)/include/libvirt/virterror.h \
		$(top_srcdir)/src/libvirt.c \
502
		$(top_srcdir)/src/libvirt-domain-checkpoint.c \
503 504 505 506 507 508 509 510 511 512
		$(top_srcdir)/src/libvirt-domain-snapshot.c \
		$(top_srcdir)/src/libvirt-domain.c \
		$(top_srcdir)/src/libvirt-host.c \
		$(top_srcdir)/src/libvirt-interface.c \
		$(top_srcdir)/src/libvirt-network.c \
		$(top_srcdir)/src/libvirt-nodedev.c \
		$(top_srcdir)/src/libvirt-nwfilter.c \
		$(top_srcdir)/src/libvirt-secret.c \
		$(top_srcdir)/src/libvirt-storage.c \
		$(top_srcdir)/src/libvirt-stream.c \
M
Michal Privoznik 已提交
513 514
		$(top_srcdir)/src/libvirt-lxc.c \
		$(top_srcdir)/src/libvirt-qemu.c \
515
		$(top_srcdir)/src/admin/libvirt-admin.c \
M
Michal Privoznik 已提交
516 517
		$(top_srcdir)/src/util/virerror.c \
		$(top_srcdir)/src/util/virevent.c \
518
		$(top_srcdir)/src/util/virtypedparam-public.c
519 520
	$(AM_V_GEN)srcdir=$(srcdir) builddir=$(builddir) \
		$(RUNUTF8) $(PYTHON) $(APIBUILD)
521
	touch $@