Makefile.am 7.8 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 79 80 81
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)

82
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
83

J
Jim Meyering 已提交
84 85
xml = \
  libvirt-api.xml \
86
  libvirt-refs.xml
J
Jim Meyering 已提交
87

88 89 90 91
qemu_xml = \
  libvirt-qemu-api.xml \
  libvirt-qemu-refs.xml

92 93 94
apidir = $(pkgdatadir)/api
api_DATA = libvirt-api.xml libvirt-qemu-api.xml

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

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

118 119 120
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
121 122
  $(addprefix $(srcdir)/,$(devhelphtml)) \
  $(addprefix $(srcdir)/,$(dot_php))
123

124
all-am: web
125

J
Jiri Denemark 已提交
126
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
127
qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
128

129
web: $(dot_html) html/index.html devhelp/index.html $(dot_php)
130

131 132 133
todo.html.in: todo.pl
	if [ -f  todo.cfg ]; then \
		echo "Generating $@"; \
E
Eric Blake 已提交
134
		$(PERL) $< > $@ \
135 136 137 138 139 140 141 142 143 144
		|| { 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

145 146 147 148
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; }

149 150
.PHONY: todo

D
Daniel Veillard 已提交
151 152 153
%.png: %.fig
	convert -rotate 90 $< $@

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

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

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

181 182 183 184 185 186 187 188 189 190 191 192
%.php.tmp: %.php.in site.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
	  $(XSLTPROC) --stringparam pagename $(@:.tmp=) --nonet --html \
	    $(top_srcdir)/docs/site.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

%.php: %.php.tmp %.php.code.in
	@echo "Scripting $@"; \
	  sed -e '/<a id="php_placeholder"><\/a>/r '"$(srcdir)/$@.code.in" \
	  -e /php_placeholder/d < $@.tmp > $(srcdir)/$@ \
	  || { rm $(srcdir)/$@ && exit 1; }
193

194
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
195
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
196
	  $(XSLTPROC) --nonet -o $(srcdir)/ \
197
	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \
198
	if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
199
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
E
Eric Blake 已提交
200
	    > /dev/null ; then \
201
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
202
	  $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
203
	  else echo "missing XHTML1 DTD" ; fi ; fi
204

205
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
206
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
207
	  $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
J
Jiri Denemark 已提交
208
	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
209

210

211 212
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
213
		$(srcdir)/html/libvirt-libvirt-qemu.html \
214 215
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
216 217 218
		$(srcdir)/libvirt-refs.xml \
		$(srcdir)/libvirt-qemu-api.xml \
		$(srcdir)/libvirt-qemu-refs.xml
219

E
Eric Blake 已提交
220 221
APIBUILD=$(srcdir)/apibuild.py
APIBUILD_STAMP=$(APIBUILD).stamp
E
Eric Blake 已提交
222
EXTRA_DIST += $(APIBUILD_STAMP)
223 224 225 226

$(python_generated_files): $(APIBUILD_STAMP)

$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
E
Eric Blake 已提交
227 228 229
		$(srcdir)/../include/libvirt/libvirt.h.in \
		$(srcdir)/../include/libvirt/libvirt-qemu.h \
		$(srcdir)/../include/libvirt/virterror.h \
230
		$(srcdir)/../src/libvirt.c \
231
		$(srcdir)/../src/libvirt-qemu.c \
232
		$(srcdir)/../src/util/virterror.c
233 234 235
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD)
	touch $@

236

237 238
check-local: all

239
clean-local:
240
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
241 242

maintainer-clean-local: clean-local
243
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in
244
	rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
245
	rm -rf $(APIBUILD_STAMP)
246

247
rebuild: api qemu_api all
248

249
install-data-local:
250
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
251 252
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
253
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
254
	for h in $(apihtml); do \
255
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
256
	for p in $(apipng); do \
257
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
258 259
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
260
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
261
	done
J
Jim Meyering 已提交
262 263

uninstall-local:
264 265
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
266
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
267 268
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done