Makefile.am 5.2 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 13 14
apihtml =			\
  html/index.html		\
  html/libvirt-libvirt.html	\
  html/libvirt-virterror.html
J
Jim Meyering 已提交
15

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

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

29 30 31 32 33
css =         \
  generic.css \
  libvirt.css \
  main.css

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

devhelpcss = devhelp/style.css

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

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

J
Jim Meyering 已提交
59 60
gif = \
  architecture.gif \
61
  node.gif
J
Jim Meyering 已提交
62

63
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in
64
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
65

66 67
patches = $(wildcard api_extension/*.patch)

J
Jim Meyering 已提交
68 69
xml = \
  libvirt-api.xml \
70
  libvirt-refs.xml
J
Jim Meyering 已提交
71

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

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

89
MAINTAINERCLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
90

91
all: web
92

93
api: libvirt-api.xml libvirt-refs.xml
94

95
web: $(dot_html) html/index.html devhelp/index.html
96

97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
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

.PHONY: todo

D
Daniel Veillard 已提交
113 114 115
%.png: %.fig
	convert -rotate 90 $< $@

116
%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in
117
	@if [ -x $(XSLTPROC) ] ; then \
118 119
	  echo "Generating $@"; \
	  name=`echo $@ | sed -e 's/.tmp//'`; \
120 121 122
	  $(XSLTPROC) --stringparam pagename $$name --nonet --html \
	    $(top_srcdir)/docs/site.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi
123 124

%.html: %.html.tmp
125
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
126
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' \
127
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
128
	  echo "Validating $@" ; \
129 130
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
	  $(XMLLINT) --catalogs --nonet --format --valid $< > $@ \
131 132
	  || { rm $@ && exit 1; }; \
	  else echo "missing XHTML1 DTD" ; fi ; fi
133 134


135
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
136
	-@if [ -x $(XSLTPROC) ] ; then \
137
	  echo "Rebuilding the HTML pages from the XML API" ; \
138 139
	  $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi
	-@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
140
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \
E
Eric Blake 已提交
141
	    > /dev/null ; then \
142
	  echo "Validating the resulting XHTML pages" ; \
143 144
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
	  $(XMLLINT) --catalogs --nonet --valid --noout html/*.html ; \
145
	  else echo "missing XHTML1 DTD" ; fi ; fi
146

147
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
148 149
	-@echo Rebuilding devhelp files
	-@if [ -x $(XSLTPROC) ] ; then \
150
	  $(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \
151
	  $(top_srcdir)/docs/devhelp/devhelp.xsl libvirt-api.xml ; fi
152

153 154 155 156 157
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
		$(srcdir)/libvirt-refs.xml
158

159 160 161
$(python_generated_files): $(srcdir)/apibuild.py \
		$(srcdir)/../include/libvirt/*.h \
		$(srcdir)/../src/libvirt.c \
162
		$(srcdir)/../src/util/virterror.c
163
	-srcdir=$(srcdir) $(srcdir)/apibuild.py
164

165 166
check-local: all

167
clean-local:
168
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
169 170

maintainer-clean-local: clean-local
171
	rm -rf libvirt-api.xml libvirt-refs.xml todo.html.in
172 173 174

rebuild: api all

175
install-data-local:
176
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
177 178
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
C
Cole Robinson 已提交
179
	-$(INSTALL) -m 0644 $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
180
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
181
	for h in $(apihtml); do \
182
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
183
	for p in $(apipng); do \
184
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
185 186
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
187
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
188
	done
J
Jim Meyering 已提交
189 190

uninstall-local:
191 192
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
193
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
194 195
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done