Makefile.am 8.7 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 75 76 77 78 79 80 81

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
82
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
83

84 85 86 87
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)

88
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
89

J
Jim Meyering 已提交
90 91
xml = \
  libvirt-api.xml \
92
  libvirt-refs.xml
J
Jim Meyering 已提交
93

94 95 96 97
qemu_xml = \
  libvirt-qemu-api.xml \
  libvirt-qemu-refs.xml

98 99 100 101
lxc_xml = \
  libvirt-lxc-api.xml \
  libvirt-lxc-refs.xml

102
apidir = $(pkgdatadir)/api
103
api_DATA = libvirt-api.xml libvirt-qemu-api.xml libvirt-lxc-api.xml
104

105 106
fig = \
  libvirt-net-logical.fig \
D
Daniel Veillard 已提交
107 108 109
  libvirt-net-physical.fig \
  libvirt-daemon-arch.fig \
  libvirt-driver-arch.fig \
110 111 112 113 114 115
  libvirt-object-model.fig \
  migration-managed-direct.fig \
  migration-managed-p2p.fig \
  migration-native.fig \
  migration-tunnel.fig \
  migration-unmanaged-direct.fig
116

J
Jim Meyering 已提交
117
EXTRA_DIST=					\
118
  apibuild.py \
119
  site.xsl newapi.xsl news.xsl page.xsl \
120
  hacking1.xsl hacking2.xsl wrapstring.xsl \
121
  $(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
122
  $(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
123
  $(xml) $(qemu_xml) $(lxc_xml) $(fig) $(png) $(css) \
124
  $(patches) $(dot_php_in) $(dot_php_code_in) $(dot_php)\
125
  $(internals_html_in) $(internals_html) \
126
  sitemap.html.in \
127
  todo.pl hvsupport.pl todo.cfg-example
J
Jim Meyering 已提交
128

129 130 131
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
132
  $(addprefix $(srcdir)/,$(devhelphtml)) \
133
  $(addprefix $(srcdir)/,$(internals_html)) \
134
  $(addprefix $(srcdir)/,$(dot_php))
135

136
all-am: web
137

J
Jiri Denemark 已提交
138
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
139
qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
140
lxc_api: $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
141

142 143
web: $(dot_html) $(internals_html) html/index.html devhelp/index.html \
  $(dot_php)
144

145 146 147
todo.html.in: todo.pl
	if [ -f  todo.cfg ]; then \
		echo "Generating $@"; \
E
Eric Blake 已提交
148
		$(PERL) $< > $@ \
149 150 151 152 153 154 155 156 157 158
		|| { 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

159
hvsupport.html.in: $(srcdir)/hvsupport.pl $(srcdir)/../src/libvirt_public.syms \
160 161
	$(srcdir)/../src/libvirt_qemu.syms $(srcdir)/../src/libvirt_lxc.syms \
	$(srcdir)/../src/driver.h
162 163
	$(AM_V_GEN)$(PERL) $(srcdir)/hvsupport.pl $(srcdir)/../src > $@ || { rm $@ && exit 1; }

164 165
.PHONY: todo

D
Daniel Veillard 已提交
166 167 168
%.png: %.fig
	convert -rotate 90 $< $@

169 170 171
internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
172
	  $(MKDIR_P) internals; \
173 174 175 176 177
	  name=`echo $@ | sed -e 's/.tmp//'`; \
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/subsite.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

178
%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in
179
	@if [ -x $(XSLTPROC) ] ; then \
180 181
	  echo "Generating $@"; \
	  name=`echo $@ | sed -e 's/.tmp//'`; \
182 183 184
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/site.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi
185 186

%.html: %.html.tmp
187
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
188
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' \
189
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
190
	  echo "Validating $@" ; \
191
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
192 193
	  $(XMLLINT) --catalogs --nonet --format --valid $< > $(srcdir)/$@ \
	  || { rm $(srcdir)/$@ && exit 1; }; \
194
	  else echo "missing XHTML1 DTD" ; fi ; fi
195

196 197 198 199 200 201 202 203
%.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
204 205 206 207 208
	@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
209

210
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
211
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
212
	  $(XSLTPROC) --nonet -o $(srcdir)/ \
213
	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \
214
	if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
215
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
E
Eric Blake 已提交
216
	    > /dev/null ; then \
217
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
218
	  $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
219
	  else echo "missing XHTML1 DTD" ; fi ; fi
220

221
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
222
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
223
	  $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
J
Jiri Denemark 已提交
224
	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
225

226

227 228
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
229
		$(srcdir)/html/libvirt-libvirt-lxc.html \
230
		$(srcdir)/html/libvirt-libvirt-qemu.html \
231 232
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
233
		$(srcdir)/libvirt-refs.xml \
234 235
		$(srcdir)/libvirt-lxc-api.xml \
		$(srcdir)/libvirt-lxc-refs.xml \
236
		$(srcdir)/libvirt-qemu-api.xml \
237 238
		$(srcdir)/libvirt-qemu-refs.xml \
		$(NULL)
239

E
Eric Blake 已提交
240 241
APIBUILD=$(srcdir)/apibuild.py
APIBUILD_STAMP=$(APIBUILD).stamp
E
Eric Blake 已提交
242
EXTRA_DIST += $(APIBUILD_STAMP)
243 244 245 246

$(python_generated_files): $(APIBUILD_STAMP)

$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
E
Eric Blake 已提交
247
		$(srcdir)/../include/libvirt/libvirt.h.in \
248
		$(srcdir)/../include/libvirt/libvirt-lxc.h \
E
Eric Blake 已提交
249 250
		$(srcdir)/../include/libvirt/libvirt-qemu.h \
		$(srcdir)/../include/libvirt/virterror.h \
251
		$(srcdir)/../src/libvirt.c \
252
		$(srcdir)/../src/libvirt-lxc.c \
253
		$(srcdir)/../src/libvirt-qemu.c \
254 255
		$(srcdir)/../src/util/virerror.c \
		$(srcdir)/../src/util/virevent.c
256 257 258
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(APIBUILD)
	touch $@

259

260 261
check-local: all

262
clean-local:
263
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
264 265

maintainer-clean-local: clean-local
266
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in
267
	rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
268
	rm -rf $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
269
	rm -rf $(APIBUILD_STAMP)
270

271
rebuild: api qemu_api lxc_api all
272

273
install-data-local:
274
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
275 276
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
277
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
278
	for h in $(apihtml); do \
279
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
280
	for p in $(apipng); do \
281
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
282 283 284
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/internals
	for f in $(internals_html); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/internals; done
285 286
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
287
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
288
	done
J
Jim Meyering 已提交
289 290

uninstall-local:
291 292
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
293
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
294 295
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done