Makefile.am 5.6 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 64
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in \
      $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
65
dot_html = $(dot_html_in:%.html.in=%.html)
J
Jim Meyering 已提交
66

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

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

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

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

91
MAINTAINERCLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
92

93
all: web
94

95
api: libvirt-api.xml libvirt-refs.xml
96

97
web: $(dot_html) html/index.html devhelp/index.html
98

99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
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 已提交
115 116 117
%.png: %.fig
	convert -rotate 90 $< $@

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

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

%.html: %.html.tmp
136
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
137
	  if $(XMLCATALOG) '$(XML_CATALOG_FILE)' \
138
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
139
	  echo "Validating $@" ; \
140 141
	  SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \
	  $(XMLLINT) --catalogs --nonet --format --valid $< > $@ \
142 143
	  || { rm $@ && exit 1; }; \
	  else echo "missing XHTML1 DTD" ; fi ; fi
144 145


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

158
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl)
159 160
	-@echo Rebuilding devhelp files
	-@if [ -x $(XSLTPROC) ] ; then \
161
	  $(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \
162
	  $(top_srcdir)/docs/devhelp/devhelp.xsl libvirt-api.xml ; fi
163

164 165 166 167 168
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
		$(srcdir)/libvirt-refs.xml
169

170 171 172
$(python_generated_files): $(srcdir)/apibuild.py \
		$(srcdir)/../include/libvirt/*.h \
		$(srcdir)/../src/libvirt.c \
173
		$(srcdir)/../src/util/virterror.c
174
	-srcdir=$(srcdir) $(srcdir)/apibuild.py
175

176 177
check-local: all

178
clean-local:
179
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
180 181

maintainer-clean-local: clean-local
182
	rm -rf libvirt-api.xml libvirt-refs.xml todo.html.in
183 184 185

rebuild: api all

186
install-data-local:
187
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
188 189
	for f in $(css) $(dot_html) $(gif) $(png); do \
	  $(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR); done
190
	$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
191
	for h in $(apihtml); do \
192
	  $(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
193
	for p in $(apipng); do \
194
	  $(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
195 196
	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
	for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
197
	    $(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
198
	done
J
Jim Meyering 已提交
199 200

uninstall-local:
201 202
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
203
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
204 205
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done