Makefile.am 5.3 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 76
  apibuild.py \
  site.xsl newapi.xsl news.xsl page.xsl ChangeLog.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 83
  ChangeLog.awk \
  todo.pl todo.cfg-example
J
Jim Meyering 已提交
84

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

87
all: web
88

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

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

93
ChangeLog.xml: ../ChangeLog ChangeLog.awk
94
	$(AWK) -f ChangeLog.awk < $< > $@
95 96

ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
97
	@if [ -x $(XSLTPROC) ] ; then \
98 99
	  echo "Generating $@"; \
	  name=`echo $@ | sed -e 's/.tmp//'`; \
100 101
	  $(XSLTPROC) --nonet $(top_srcdir)/docs/ChangeLog.xsl $< > $@ \
	    || { rm $@ && exit 1; }; fi
102

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

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

%.html: %.html.tmp
131 132 133
	@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
	  if $(XMLCATALOG) /etc/xml/catalog \
	    "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
134
	  echo "Validating $@" ; \
135 136 137
	  $(XMLLINT) --nonet --format --valid $< > $@ \
	  || { rm $@ && exit 1; }; \
	  else echo "missing XHTML1 DTD" ; fi ; fi
138 139


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

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

157 158 159 160 161
python_generated_files = \
		$(srcdir)/html/libvirt-libvirt.html \
		$(srcdir)/html/libvirt-virterror.html \
		$(srcdir)/libvirt-api.xml \
		$(srcdir)/libvirt-refs.xml
162

163 164 165
$(python_generated_files): $(srcdir)/apibuild.py \
		$(srcdir)/../include/libvirt/*.h \
		$(srcdir)/../src/libvirt.c \
166
		$(srcdir)/../src/util/virterror.c
167
	-srcdir=$(srcdir) $(srcdir)/apibuild.py
168

169 170
check-local: all

171
clean-local:
172
	rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
173 174

maintainer-clean-local: clean-local
175
	rm -rf libvirt-api.xml libvirt-refs.xml todo.html.in
176 177 178

rebuild: api all

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

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