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 107 108 109 110 111 112 113 114 115 116 117
todo.html.in: todo.pl
	if [ -f  todo.cfg ]; then \
		echo "Generating $@"; \
		$(PERL) $(srcdir)/$< > $@ \
		|| { 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 130 131 132 133 134
internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
	@if [ -x $(XSLTPROC) ] ; then \
	  echo "Generating $@"; \
	  name=`echo $@ | sed -e 's/.tmp//'`; \
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/subsite.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi

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

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


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

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

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

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

185 186
check-local: all

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

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

rebuild: api all

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

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