Makefile.am 5.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 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 126 127
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
	  if $(XMLCATALOG) /etc/xml/catalog \
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
128
	  echo "Validating $@" ; \
129 130 131
	  $(XMLLINT) --nonet --format --valid $< > $@ \
	  || { rm $@ && exit 1; }; \
	  else echo "missing XHTML1 DTD" ; fi ; fi
132 133


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

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

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

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

163 164
check-local: all

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

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

rebuild: api all

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

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