Makefile.am 5.8 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
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
68

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 92 93 94
MAINTAINERCLEANFILES = \
  $(addprefix $(srcdir)/,$(dot_html)) \
  $(addprefix $(srcdir)/,$(apihtml)) \
  $(addprefix $(srcdir)/,$(devhelphtml))
95

96
all: web
97

J
Jiri Denemark 已提交
98
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
99

100
web: $(dot_html) html/index.html devhelp/index.html
101

102 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

.PHONY: todo

D
Daniel Veillard 已提交
118 119 120
%.png: %.fig
	convert -rotate 90 $< $@

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

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

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


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

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

168 169 170 171 172
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
		$(srcdir)/libvirt-refs.xml
173

174 175 176
$(python_generated_files): $(srcdir)/apibuild.py \
		$(srcdir)/../include/libvirt/*.h \
		$(srcdir)/../src/libvirt.c \
177
		$(srcdir)/../src/util/virterror.c
178
	-srcdir=$(srcdir) $(srcdir)/apibuild.py
179

180 181
check-local: all

182
clean-local:
183
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
184 185

maintainer-clean-local: clean-local
J
Jiri Denemark 已提交
186
	rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml todo.html.in
187 188 189

rebuild: api all

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

uninstall-local:
205 206
	for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
	for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
207
	for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
208 209
	  rm $(DESTDIR)$(DEVHELP_DIR)/$$(basename $$f); \
	done