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

E
Eric Blake 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
## Copyright (C) 2005-2013 Red Hat, Inc.
##
## 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
SUBDIRS= schemas
20

21 22
PERL = perl

23 24 25
# The directory containing the source code (if it contains documentation).
DOC_SOURCE_DIR=../src

26 27
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt

28 29 30 31
apihtml =			\
  html/index.html		\
  html/libvirt-libvirt.html	\
  html/libvirt-virterror.html
J
Jim Meyering 已提交
32

33
apipng =	\
34 35 36 37
  html/left.png	\
  html/up.png	\
  html/home.png	\
  html/right.png
J
Jim Meyering 已提交
38

39
devhelphtml =			\
40 41 42 43 44 45
  devhelp/libvirt.devhelp	\
  devhelp/index.html		\
  devhelp/general.html		\
  devhelp/libvirt-libvirt.html	\
  devhelp/libvirt-virterror.html

46 47 48 49 50
css =         \
  generic.css \
  libvirt.css \
  main.css

51 52 53 54 55 56 57 58 59 60
devhelppng =		\
  devhelp/home.png	\
  devhelp/left.png	\
  devhelp/right.png	\
  devhelp/up.png

devhelpcss = devhelp/style.css

devhelpxsl = devhelp/devhelp.xsl devhelp/html.xsl

61 62 63 64 65 66 67 68 69
png = \
  32favicon.png \
  footer_corner.png \
  footer_pattern.png \
  libvirt-header-bg.png \
  libvirt-header-logo.png \
  libvirtLogo.png \
  libvirt-net-logical.png \
  libvirt-net-physical.png \
D
Daniel Veillard 已提交
70 71 72
  libvirt-daemon-arch.png \
  libvirt-driver-arch.png \
  libvirt-object-model.png \
73
  madeWith.png \
74 75 76 77 78 79
  et.png \
  migration-managed-direct.png \
  migration-managed-p2p.png \
  migration-native.png \
  migration-tunnel.png \
  migration-unmanaged-direct.png
80

J
Jim Meyering 已提交
81 82
gif = \
  architecture.gif \
83
  node.gif
J
Jim Meyering 已提交
84

85 86 87 88 89

internals_html_in = \
  $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
internals_html = $(internals_html_in:%.html.in=%.html)

90 91 92 93 94 95
# todo.html is special - it is shipped in the tarball, but we
# have a dedicated 'todo' target to rebuild it from a proper
# config file, all other users are able to build it locally.
# For all other files, since we ship pre-built html in the
# tarball, we must also ship the sources, even when those
# sources are themselves generated.
96 97 98
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) \
  todo.html.in \
  hvsupport.html.in
99
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
100

101 102 103 104
dot_php_in = $(notdir $(wildcard $(srcdir)/*.php.in))
dot_php_code_in = $(dot_php_in:%.php.in=%.php.code.in)
dot_php = $(dot_php_in:%.php.in=%.php)

105
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
106

J
Jim Meyering 已提交
107 108
xml = \
  libvirt-api.xml \
109
  libvirt-refs.xml
J
Jim Meyering 已提交
110

111 112 113 114
qemu_xml = \
  libvirt-qemu-api.xml \
  libvirt-qemu-refs.xml

115 116 117 118
lxc_xml = \
  libvirt-lxc-api.xml \
  libvirt-lxc-refs.xml

119
apidir = $(pkgdatadir)/api
120
api_DATA = libvirt-api.xml libvirt-qemu-api.xml libvirt-lxc-api.xml
121

122 123
fig = \
  libvirt-net-logical.fig \
D
Daniel Veillard 已提交
124 125 126
  libvirt-net-physical.fig \
  libvirt-daemon-arch.fig \
  libvirt-driver-arch.fig \
127 128 129 130 131 132
  libvirt-object-model.fig \
  migration-managed-direct.fig \
  migration-managed-p2p.fig \
  migration-native.fig \
  migration-tunnel.fig \
  migration-unmanaged-direct.fig
133

J
Jim Meyering 已提交
134
EXTRA_DIST=					\
135
  apibuild.py genaclperms.pl \
136
  site.xsl newapi.xsl news.xsl page.xsl \
137
  hacking1.xsl hacking2.xsl wrapstring.xsl \
138
  $(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
139
  $(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
140
  $(xml) $(qemu_xml) $(lxc_xml) $(fig) $(png) $(css) \
141
  $(patches) $(dot_php_in) $(dot_php_code_in) $(dot_php)\
142
  $(internals_html_in) $(internals_html) \
143
  sitemap.html.in aclperms.htmlinc \
144
  todo.pl hvsupport.pl todo.cfg-example
J
Jim Meyering 已提交
145

146 147 148 149
acl.html:: $(srcdir)/aclperms.htmlinc

$(srcdir)/aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \
        $(srcdir)/genaclperms.pl Makefile.am
150
	$(AM_V_GEN)$(PERL) $(srcdir)/genaclperms.pl $< > $@
151

152 153 154
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
155
  $(addprefix $(srcdir)/,$(devhelphtml)) \
156
  $(addprefix $(srcdir)/,$(internals_html)) \
157 158
  $(addprefix $(srcdir)/,$(dot_php)) \
  $(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc
159

160
all-am: web
161

J
Jiri Denemark 已提交
162
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
163
qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
164
lxc_api: $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
165

166 167
web: $(dot_html) $(internals_html) html/index.html devhelp/index.html \
  $(dot_php)
168

169 170 171
todo.html.in: todo.pl
	if [ -f  todo.cfg ]; then \
		echo "Generating $@"; \
E
Eric Blake 已提交
172
		$(PERL) $< > $@ \
173 174 175
		|| { rm $@ && exit 1; }; \
	else \
		echo "Stubbing $@"; \
176 177 178 179 180
		printf "%s\n" \
		  "<html xmlns=\"http://www.w3.org/1999/xhtml\">" \
		  "<body>" \
		  "<h1>Todo list unavailable: no config file</h1>" \
		  "</body></html>" > $@ ; \
181 182 183 184 185 186
	fi

todo:
	rm -f todo.html.in
	$(MAKE) todo.html

187 188 189
hvsupport.html:: $(srcdir)/hvsupport.html.in

$(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl \
190
		$(srcdir)/../src/libvirt_public.syms \
191 192
	$(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/libvirt_lxc.syms \
	$(srcdir)/../src/driver.h
193 194
	$(AM_V_GEN)$(PERL) $(srcdir)/hvsupport.pl $(srcdir)/../src > $@ \
		|| { rm $@ && exit 1; }
195

196 197
.PHONY: todo

D
Daniel Veillard 已提交
198 199 200
%.png: %.fig
	convert -rotate 90 $< $@

201 202 203
internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
204
	  $(MKDIR_P) internals; \
205
	  name=`echo $@ | sed -e 's/.tmp//'`; \
206
	  $(XSLTPROC) --stringparam pagename $$name --nonet \
207 208 209
	    $(top_srcdir)/docs/subsite.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

210
%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in
211
	@if [ -x $(XSLTPROC) ] ; then \
212 213
	  echo "Generating $@"; \
	  name=`echo $@ | sed -e 's/.tmp//'`; \
214
	  $(XSLTPROC) --stringparam pagename $$name --nonet \
215 216
	    $(top_srcdir)/docs/site.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi
217 218

%.html: %.html.tmp
219
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
220
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' \
221
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
222
	  echo "Validating $@" ; \
223
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
224 225
	  $(XMLLINT) --catalogs --nonet --format --valid $< > $(srcdir)/$@ \
	  || { rm $(srcdir)/$@ && exit 1; }; \
226
	  else echo "missing XHTML1 DTD" ; fi ; fi
227

228 229 230
%.php.tmp: %.php.in site.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
231
	  $(XSLTPROC) --stringparam pagename $(@:.tmp=) --nonet \
232 233 234 235
	    $(top_srcdir)/docs/site.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

%.php: %.php.tmp %.php.code.in
236 237 238 239 240
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Scripting $@"; \
	    sed -e '/<a id="php_placeholder"><\/a>/r '"$(srcdir)/$@.code.in" \
	    -e /php_placeholder/d < $@.tmp > $(srcdir)/$@ \
	    || { rm $(srcdir)/$@ && exit 1; }; fi
241

242
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
243
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
244
	  $(XSLTPROC) --nonet -o $(srcdir)/ \
245
	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \
246
	if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
247
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
E
Eric Blake 已提交
248
	    > /dev/null ; then \
249
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
250
	  $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
251
	  else echo "missing XHTML1 DTD" ; fi ; fi
252

253
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
254
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
255
	  $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
J
Jiri Denemark 已提交
256
	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
257

258

259 260
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
261
		$(srcdir)/html/libvirt-libvirt-lxc.html \
262
		$(srcdir)/html/libvirt-libvirt-qemu.html \
263 264
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
265
		$(srcdir)/libvirt-refs.xml \
266 267
		$(srcdir)/libvirt-lxc-api.xml \
		$(srcdir)/libvirt-lxc-refs.xml \
268
		$(srcdir)/libvirt-qemu-api.xml \
269 270
		$(srcdir)/libvirt-qemu-refs.xml \
		$(NULL)
271

E
Eric Blake 已提交
272 273
APIBUILD=$(srcdir)/apibuild.py
APIBUILD_STAMP=$(APIBUILD).stamp
E
Eric Blake 已提交
274
EXTRA_DIST += $(APIBUILD_STAMP)
275 276 277 278

$(python_generated_files): $(APIBUILD_STAMP)

$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
E
Eric Blake 已提交
279
		$(srcdir)/../include/libvirt/libvirt.h.in \
280
		$(srcdir)/../include/libvirt/libvirt-lxc.h \
E
Eric Blake 已提交
281 282
		$(srcdir)/../include/libvirt/libvirt-qemu.h \
		$(srcdir)/../include/libvirt/virterror.h \
283
		$(srcdir)/../src/libvirt.c \
284
		$(srcdir)/../src/libvirt-lxc.c \
285
		$(srcdir)/../src/libvirt-qemu.c \
286
		$(srcdir)/../src/util/virerror.c \
287 288
		$(srcdir)/../src/util/virevent.c \
		$(srcdir)/../src/util/virtypedparam.c
289 290 291
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD)
	touch $@

292

293
check-local: all
294
dist-local: all
295

296
clean-local:
297
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
298 299

maintainer-clean-local: clean-local
300
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml \
301
		todo.html.in
302
	rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
303
	rm -rf $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
304
	rm -rf $(APIBUILD_STAMP)
305

306
rebuild: api qemu_api lxc_api all
307

308
install-data-local:
309
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
310 311
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
312
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
313
	for h in $(apihtml); do \
314
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
315
	for p in $(apipng); do \
316
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
317 318 319
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/internals
	for f in $(internals_html); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/internals; done
320 321
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
322
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
323
	done
324
	$(INSTALL_DATA) $(srcdir)/libvirtLogo.png $(DESTDIR)$(pkgdatadir)
J
Jim Meyering 已提交
325 326

uninstall-local:
327 328
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
329
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
330 331
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done