Makefile.am 4.9 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 29 30 31 32 33 34 35 36 37 38
  devhelp/libvirt.devhelp	\
  devhelp/index.html		\
  devhelp/general.html		\
  devhelp/libvirt-libvirt.html	\
  devhelp/libvirt-virterror.html

devhelppng =		\
  devhelp/home.png	\
  devhelp/left.png	\
  devhelp/right.png	\
  devhelp/up.png

devhelpcss = devhelp/style.css

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

39 40 41 42 43 44 45 46 47
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 已提交
48 49 50
  libvirt-daemon-arch.png \
  libvirt-driver-arch.png \
  libvirt-object-model.png \
51
  madeWith.png \
52
  et.png
53

J
Jim Meyering 已提交
54 55
gif = \
  architecture.gif \
56
  node.gif
J
Jim Meyering 已提交
57

58
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in
59
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
60

61 62
patches = $(wildcard api_extension/*.patch)

J
Jim Meyering 已提交
63 64
xml = \
  libvirt-api.xml \
65
  libvirt-refs.xml
J
Jim Meyering 已提交
66

67 68
fig = \
  libvirt-net-logical.fig \
D
Daniel Veillard 已提交
69 70 71 72
  libvirt-net-physical.fig \
  libvirt-daemon-arch.fig \
  libvirt-driver-arch.fig \
  libvirt-object-model.fig
73

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

84
MAINTAINERCLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
85

86
all: web
87

88
api: libvirt-api.xml libvirt-refs.xml
89

90
web: $(dot_html) html/index.html devhelp/index.html
91

92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
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 已提交
108 109 110
%.png: %.fig
	convert -rotate 90 $< $@

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

%.html: %.html.tmp
120 121 122
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
	  if $(XMLCATALOG) /etc/xml/catalog \
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
123
	  echo "Validating $@" ; \
124 125 126
	  $(XMLLINT) --nonet --format --valid $< > $@ \
	  || { rm $@ && exit 1; }; \
	  else echo "missing XHTML1 DTD" ; fi ; fi
127 128


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

140
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
141 142
	-@echo Rebuilding devhelp files
	-@if [ -x $(XSLTPROC) ] ; then \
143
	  $(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \
144
	  $(top_srcdir)/docs/devhelp/devhelp.xsl libvirt-api.xml ; fi
145

146 147 148 149 150
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
		$(srcdir)/libvirt-refs.xml
151

152 153 154
$(python_generated_files): $(srcdir)/apibuild.py \
		$(srcdir)/../include/libvirt/*.h \
		$(srcdir)/../src/libvirt.c \
155
		$(srcdir)/../src/util/virterror.c
156
	-srcdir=$(srcdir) $(srcdir)/apibuild.py
157

158 159
check-local: all

160
clean-local:
161
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
162 163

maintainer-clean-local: clean-local
164
	rm -rf libvirt-api.xml libvirt-refs.xml todo.html.in
165 166 167

rebuild: api all

168
install-data-local:
169
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
C
Cole Robinson 已提交
170
	-$(INSTALL) -m 0644 $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
171
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
172
	for h in $(apihtml); do \
173
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
174
	for p in $(apipng); do \
175
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
176 177
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
178
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
179
	done
J
Jim Meyering 已提交
180 181

uninstall-local:
182 183
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
184
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
185 186
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done