Makefile.am 6.1 KB
Newer Older
1
## Process this file with automake to produce Makefile.in
2
SUBDIRS= schemas
3

4 5
PERL = perl

6 7 8
# The directory containing the source code (if it contains documentation).
DOC_SOURCE_DIR=../src

9 10
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt

11 12
BUILT_SOURCES=hvsupport.html.in

13 14 15 16
apihtml =			\
  html/index.html		\
  html/libvirt-libvirt.html	\
  html/libvirt-virterror.html
J
Jim Meyering 已提交
17

18
apipng =	\
19 20 21 22
  html/left.png	\
  html/up.png	\
  html/home.png	\
  html/right.png
J
Jim Meyering 已提交
23

24
devhelphtml =			\
25 26 27 28 29 30
  devhelp/libvirt.devhelp	\
  devhelp/index.html		\
  devhelp/general.html		\
  devhelp/libvirt-libvirt.html	\
  devhelp/libvirt-virterror.html

31 32 33 34 35
css =         \
  generic.css \
  libvirt.css \
  main.css

36 37 38 39 40 41 42 43 44 45
devhelppng =		\
  devhelp/home.png	\
  devhelp/left.png	\
  devhelp/right.png	\
  devhelp/up.png

devhelpcss = devhelp/style.css

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

46 47 48 49 50 51 52 53 54
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 已提交
55 56 57
  libvirt-daemon-arch.png \
  libvirt-driver-arch.png \
  libvirt-object-model.png \
58
  madeWith.png \
59
  et.png
60

J
Jim Meyering 已提交
61 62
gif = \
  architecture.gif \
63
  node.gif
J
Jim Meyering 已提交
64

65
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in hvsupport.html.in \
66
      $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
67
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
68

69
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
70

J
Jim Meyering 已提交
71 72
xml = \
  libvirt-api.xml \
73
  libvirt-refs.xml
J
Jim Meyering 已提交
74

75 76
fig = \
  libvirt-net-logical.fig \
D
Daniel Veillard 已提交
77 78 79 80
  libvirt-net-physical.fig \
  libvirt-daemon-arch.fig \
  libvirt-driver-arch.fig \
  libvirt-object-model.fig
81

J
Jim Meyering 已提交
82
EXTRA_DIST=					\
83
  apibuild.py \
84
  site.xsl newapi.xsl news.xsl page.xsl \
85
  hacking1.xsl hacking2.xsl wrapstring.xsl \
86
  $(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
87
  $(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
88
  $(xml) $(fig) $(png) $(css) \
89
  $(patches) \
90
  sitemap.html.in \
91
  todo.pl hvsupport.pl todo.cfg-example
J
Jim Meyering 已提交
92

93 94 95 96
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
  $(addprefix $(srcdir)/,$(devhelphtml))
97

98
all: web
99

J
Jiri Denemark 已提交
100
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
101

102
web: $(dot_html) html/index.html devhelp/index.html
103

104 105 106
todo.html.in: todo.pl
	if [ -f  todo.cfg ]; then \
		echo "Generating $@"; \
E
Eric Blake 已提交
107
		$(PERL) $< > $@ \
108 109 110 111 112 113 114 115 116 117
		|| { 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

118 119 120 121
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; }

122 123
.PHONY: todo

D
Daniel Veillard 已提交
124 125 126
%.png: %.fig
	convert -rotate 90 $< $@

127 128 129
internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
130
	  $(MKDIR_P) internals; \
131 132 133 134 135
	  name=`echo $@ | sed -e 's/.tmp//'`; \
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/subsite.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

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

%.html: %.html.tmp
145
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
146
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' \
147
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
148
	  echo "Validating $@" ; \
149
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
150 151
	  $(XMLLINT) --catalogs --nonet --format --valid $< > $(srcdir)/$@ \
	  || { rm $(srcdir)/$@ && exit 1; }; \
152
	  else echo "missing XHTML1 DTD" ; fi ; fi
153 154


155
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
156
	-@if [ -x $(XSLTPROC) ] ; then \
157
	  echo "Rebuilding the HTML pages from the XML API" ; \
158 159
	  $(XSLTPROC) --nonet -o $(srcdir)/ \
	  $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi
160
	-@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
161
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
E
Eric Blake 已提交
162
	    > /dev/null ; then \
163
	  echo "Validating the resulting XHTML pages" ; \
164
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
165
	  $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \
166
	  else echo "missing XHTML1 DTD" ; fi ; fi
167

168
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
169 170
	-@echo Rebuilding devhelp files
	-@if [ -x $(XSLTPROC) ] ; then \
171
	  $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \
J
Jiri Denemark 已提交
172
	  $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi
173

174 175 176 177 178
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
		$(srcdir)/libvirt-refs.xml
179

180 181 182
$(python_generated_files): $(srcdir)/apibuild.py \
		$(srcdir)/../include/libvirt/*.h \
		$(srcdir)/../src/libvirt.c \
183
		$(srcdir)/../src/util/virterror.c
184
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/apibuild.py
185

186 187
check-local: all

188
clean-local:
189
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
190 191

maintainer-clean-local: clean-local
192
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in hvsupport.html.in
193 194 195

rebuild: api all

196
install-data-local:
197
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
198 199
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
200
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
201
	for h in $(apihtml); do \
202
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
203
	for p in $(apipng); do \
204
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
205 206
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
207
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
208
	done
J
Jim Meyering 已提交
209 210

uninstall-local:
211 212
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
213
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
214 215
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done