Makefile.am 9.8 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
BUILT_SOURCES=hvsupport.html.in

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

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

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

48 49 50 51 52
css =         \
  generic.css \
  libvirt.css \
  main.css

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

devhelpcss = devhelp/style.css

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

63 64 65 66 67 68 69 70 71
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 已提交
72 73 74
  libvirt-daemon-arch.png \
  libvirt-driver-arch.png \
  libvirt-object-model.png \
75
  madeWith.png \
76 77 78 79 80 81
  et.png \
  migration-managed-direct.png \
  migration-managed-p2p.png \
  migration-native.png \
  migration-tunnel.png \
  migration-unmanaged-direct.png
82

J
Jim Meyering 已提交
83 84
gif = \
  architecture.gif \
85
  node.gif
J
Jim Meyering 已提交
86

87 88 89 90 91 92 93 94

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

dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) \
  todo.html.in \
  hvsupport.html.in
95
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
96

97 98 99 100
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)

101
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
102

J
Jim Meyering 已提交
103 104
xml = \
  libvirt-api.xml \
105
  libvirt-refs.xml
J
Jim Meyering 已提交
106

107 108 109 110
qemu_xml = \
  libvirt-qemu-api.xml \
  libvirt-qemu-refs.xml

111 112 113 114
lxc_xml = \
  libvirt-lxc-api.xml \
  libvirt-lxc-refs.xml

115
apidir = $(pkgdatadir)/api
116
api_DATA = libvirt-api.xml libvirt-qemu-api.xml libvirt-lxc-api.xml
117

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

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

142 143 144 145 146 147 148 149 150 151
BUILT_SOURCES += aclperms.htmlinc

CLEANFILES = $(srcdir)/aclperms.htmlinc

acl.html:: $(srcdir)/aclperms.htmlinc

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

152 153 154
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
155
  $(addprefix $(srcdir)/,$(devhelphtml)) \
156
  $(addprefix $(srcdir)/,$(internals_html)) \
157
  $(addprefix $(srcdir)/,$(dot_php))
158

159
all-am: web
160

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

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

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

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

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

193 194
.PHONY: todo

D
Daniel Veillard 已提交
195 196 197
%.png: %.fig
	convert -rotate 90 $< $@

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

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

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

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

%.php: %.php.tmp %.php.code.in
233 234 235 236 237
	@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
238

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

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

255

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

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

$(python_generated_files): $(APIBUILD_STAMP)

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

289

290
check-local: all
291
dist-local: all
292

293
clean-local:
294
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
295 296

maintainer-clean-local: clean-local
297 298
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml \
		todo.html.in hvsupport.html.in
299
	rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
300
	rm -rf $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
301
	rm -rf $(APIBUILD_STAMP)
302

303
rebuild: api qemu_api lxc_api all
304

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

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