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

E
Eric Blake 已提交
3
## Copyright (C) 2005-2012 Red Hat, Inc.
4 5
## See COPYING.LIB for the License of this software

6
SUBDIRS= schemas
7

8 9
PERL = perl

10 11 12
# The directory containing the source code (if it contains documentation).
DOC_SOURCE_DIR=../src

13 14
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt

15 16
BUILT_SOURCES=hvsupport.html.in

17 18 19 20
apihtml =			\
  html/index.html		\
  html/libvirt-libvirt.html	\
  html/libvirt-virterror.html
J
Jim Meyering 已提交
21

22
apipng =	\
23 24 25 26
  html/left.png	\
  html/up.png	\
  html/home.png	\
  html/right.png
J
Jim Meyering 已提交
27

28
devhelphtml =			\
29 30 31 32 33 34
  devhelp/libvirt.devhelp	\
  devhelp/index.html		\
  devhelp/general.html		\
  devhelp/libvirt-libvirt.html	\
  devhelp/libvirt-virterror.html

35 36 37 38 39
css =         \
  generic.css \
  libvirt.css \
  main.css

40 41 42 43 44 45 46 47 48 49
devhelppng =		\
  devhelp/home.png	\
  devhelp/left.png	\
  devhelp/right.png	\
  devhelp/up.png

devhelpcss = devhelp/style.css

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

50 51 52 53 54 55 56 57 58
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 已提交
59 60 61
  libvirt-daemon-arch.png \
  libvirt-driver-arch.png \
  libvirt-object-model.png \
62
  madeWith.png \
63 64 65 66 67 68
  et.png \
  migration-managed-direct.png \
  migration-managed-p2p.png \
  migration-native.png \
  migration-tunnel.png \
  migration-unmanaged-direct.png
69

J
Jim Meyering 已提交
70 71
gif = \
  architecture.gif \
72
  node.gif
J
Jim Meyering 已提交
73

74
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in hvsupport.html.in \
75
      $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
76
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
77

78
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
79

J
Jim Meyering 已提交
80 81
xml = \
  libvirt-api.xml \
82
  libvirt-refs.xml
J
Jim Meyering 已提交
83

84 85 86 87
qemu_xml = \
  libvirt-qemu-api.xml \
  libvirt-qemu-refs.xml

88 89 90
apidir = $(pkgdatadir)/api
api_DATA = libvirt-api.xml libvirt-qemu-api.xml

91 92
fig = \
  libvirt-net-logical.fig \
D
Daniel Veillard 已提交
93 94 95
  libvirt-net-physical.fig \
  libvirt-daemon-arch.fig \
  libvirt-driver-arch.fig \
96 97 98 99 100 101
  libvirt-object-model.fig \
  migration-managed-direct.fig \
  migration-managed-p2p.fig \
  migration-native.fig \
  migration-tunnel.fig \
  migration-unmanaged-direct.fig
102

J
Jim Meyering 已提交
103
EXTRA_DIST=					\
104
  apibuild.py \
105
  site.xsl newapi.xsl news.xsl page.xsl \
106
  hacking1.xsl hacking2.xsl wrapstring.xsl \
107
  $(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
108
  $(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
109
  $(xml) $(qemu_xml) $(fig) $(png) $(css) \
110
  $(patches) \
111
  sitemap.html.in \
112
  todo.pl hvsupport.pl todo.cfg-example
J
Jim Meyering 已提交
113

114 115 116 117
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
  $(addprefix $(srcdir)/,$(devhelphtml))
118

119
all-am: web
120

J
Jiri Denemark 已提交
121
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
122
qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
123

124
web: $(dot_html) html/index.html devhelp/index.html
125

126 127 128
todo.html.in: todo.pl
	if [ -f  todo.cfg ]; then \
		echo "Generating $@"; \
E
Eric Blake 已提交
129
		$(PERL) $< > $@ \
130 131 132 133 134 135 136 137 138 139
		|| { rm $@ && exit 1; }; \
	else \
		echo "Stubbing $@"; \
		echo "<html><body><h1>Todo list</h1></body></html>" > $@ ; \
	fi

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

140 141 142 143
hvsupport.html.in: $(srcdir)/hvsupport.pl $(srcdir)/../src/libvirt_public.syms \
	 $(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/driver.h
	$(AM_V_GEN)$(PERL) $(srcdir)/hvsupport.pl $(srcdir)/../src > $@ || { rm $@ && exit 1; }

144 145
.PHONY: todo

D
Daniel Veillard 已提交
146 147 148
%.png: %.fig
	convert -rotate 90 $< $@

149 150 151
internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
152
	  $(MKDIR_P) internals; \
153 154 155 156 157
	  name=`echo $@ | sed -e 's/.tmp//'`; \
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/subsite.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

158
%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in
159
	@if [ -x $(XSLTPROC) ] ; then \
160 161
	  echo "Generating $@"; \
	  name=`echo $@ | sed -e 's/.tmp//'`; \
162 163 164
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/site.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi
165 166

%.html: %.html.tmp
167
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
168
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' \
169
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
170
	  echo "Validating $@" ; \
171
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
172 173
	  $(XMLLINT) --catalogs --nonet --format --valid $< > $(srcdir)/$@ \
	  || { rm $(srcdir)/$@ && exit 1; }; \
174
	  else echo "missing XHTML1 DTD" ; fi ; fi
175 176


177
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
178
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
179
	  $(XSLTPROC) --nonet -o $(srcdir)/ \
180
	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \
181
	if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
182
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
E
Eric Blake 已提交
183
	    > /dev/null ; then \
184
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
185
	  $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
186
	  else echo "missing XHTML1 DTD" ; fi ; fi
187

188
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
189
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
190
	  $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
J
Jiri Denemark 已提交
191
	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
192

193

194 195
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
196
		$(srcdir)/html/libvirt-libvirt-qemu.html \
197 198
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
199 200 201
		$(srcdir)/libvirt-refs.xml \
		$(srcdir)/libvirt-qemu-api.xml \
		$(srcdir)/libvirt-qemu-refs.xml
202

E
Eric Blake 已提交
203 204
APIBUILD=$(srcdir)/apibuild.py
APIBUILD_STAMP=$(APIBUILD).stamp
E
Eric Blake 已提交
205
EXTRA_DIST += $(APIBUILD_STAMP)
206 207 208 209

$(python_generated_files): $(APIBUILD_STAMP)

$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
E
Eric Blake 已提交
210 211 212
		$(srcdir)/../include/libvirt/libvirt.h.in \
		$(srcdir)/../include/libvirt/libvirt-qemu.h \
		$(srcdir)/../include/libvirt/virterror.h \
213
		$(srcdir)/../src/libvirt.c \
214
		$(srcdir)/../src/libvirt-qemu.c \
215
		$(srcdir)/../src/util/virterror.c
216 217 218
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD)
	touch $@

219

220 221
check-local: all

222
clean-local:
223
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
224 225

maintainer-clean-local: clean-local
226
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in
227
	rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
228
	rm -rf $(APIBUILD_STAMP)
229

230
rebuild: api qemu_api all
231

232
install-data-local:
233
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
234 235
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
236
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
237
	for h in $(apihtml); do \
238
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
239
	for p in $(apipng); do \
240
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
241 242
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
243
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
244
	done
J
Jim Meyering 已提交
245 246

uninstall-local:
247 248
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
249
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
250 251
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done