Makefile.am 6.5 KB
Newer Older
1
## Process this file with automake to produce Makefile.in
2 3 4 5

## Copyright (C) 2005-2011 Red Hat, Inc.
## 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
  et.png
64

J
Jim Meyering 已提交
65 66
gif = \
  architecture.gif \
67
  node.gif
J
Jim Meyering 已提交
68

69
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in hvsupport.html.in \
70
      $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
71
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
72

73
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
74

J
Jim Meyering 已提交
75 76
xml = \
  libvirt-api.xml \
77
  libvirt-refs.xml
J
Jim Meyering 已提交
78

79 80 81 82
qemu_xml = \
  libvirt-qemu-api.xml \
  libvirt-qemu-refs.xml

83 84
fig = \
  libvirt-net-logical.fig \
D
Daniel Veillard 已提交
85 86 87 88
  libvirt-net-physical.fig \
  libvirt-daemon-arch.fig \
  libvirt-driver-arch.fig \
  libvirt-object-model.fig
89

J
Jim Meyering 已提交
90
EXTRA_DIST=					\
91
  apibuild.py \
92
  site.xsl newapi.xsl news.xsl page.xsl \
93
  hacking1.xsl hacking2.xsl wrapstring.xsl \
94
  $(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
95
  $(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
96
  $(xml) $(qemu_xml) $(fig) $(png) $(css) \
97
  $(patches) \
98
  sitemap.html.in \
99
  todo.pl hvsupport.pl todo.cfg-example
J
Jim Meyering 已提交
100

101 102 103 104
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
  $(addprefix $(srcdir)/,$(devhelphtml))
105

106
all: web
107

J
Jiri Denemark 已提交
108
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
109
qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
110

111
web: $(dot_html) html/index.html devhelp/index.html
112

113 114 115
todo.html.in: todo.pl
	if [ -f  todo.cfg ]; then \
		echo "Generating $@"; \
E
Eric Blake 已提交
116
		$(PERL) $< > $@ \
117 118 119 120 121 122 123 124 125 126
		|| { 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

127 128 129 130
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; }

131 132
.PHONY: todo

D
Daniel Veillard 已提交
133 134 135
%.png: %.fig
	convert -rotate 90 $< $@

136 137 138
internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
139
	  $(MKDIR_P) internals; \
140 141 142 143 144
	  name=`echo $@ | sed -e 's/.tmp//'`; \
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/subsite.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

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

%.html: %.html.tmp
154
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
155
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' \
156
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
157
	  echo "Validating $@" ; \
158
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
159 160
	  $(XMLLINT) --catalogs --nonet --format --valid $< > $(srcdir)/$@ \
	  || { rm $(srcdir)/$@ && exit 1; }; \
161
	  else echo "missing XHTML1 DTD" ; fi ; fi
162 163


164
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
165
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
166
	  $(XSLTPROC) --nonet -o $(srcdir)/ \
167
	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \
168
	if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
169
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
E
Eric Blake 已提交
170
	    > /dev/null ; then \
171
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
172
	  $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
173
	  else echo "missing XHTML1 DTD" ; fi ; fi
174

175
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
176
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
177
	  $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
J
Jiri Denemark 已提交
178
	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
179

180

181 182
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
183
		$(srcdir)/html/libvirt-libvirt-qemu.html \
184 185
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
186 187 188
		$(srcdir)/libvirt-refs.xml \
		$(srcdir)/libvirt-qemu-api.xml \
		$(srcdir)/libvirt-qemu-refs.xml
189

190 191 192
$(python_generated_files): $(srcdir)/apibuild.py \
		$(srcdir)/../include/libvirt/*.h \
		$(srcdir)/../src/libvirt.c \
193
		$(srcdir)/../src/libvirt-qemu.c \
194
		$(srcdir)/../src/util/virterror.c
195
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/apibuild.py
196

197 198
check-local: all

199
clean-local:
200
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
201 202

maintainer-clean-local: clean-local
203
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in
204
	rm -rf $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
205

206
rebuild: api qemu_api all
207

208
install-data-local:
209
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
210 211
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
212
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
213
	for h in $(apihtml); do \
214
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
215
	for p in $(apipng); do \
216
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
217 218
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
219
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
220
	done
J
Jim Meyering 已提交
221 222

uninstall-local:
223 224
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
225
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
226 227
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done