Makefile.am 3.7 KB
Newer Older
D
Daniel Veillard 已提交
1 2
## Process this file with automake to produce Makefile.in

3 4 5
LCOV = lcov
GENHTML = genhtml

6
SUBDIRS = gnulib/lib include src daemon tools docs gnulib/tests \
7
  python tests po examples/domain-events/events-c examples/hellolibvirt \
S
Stefan Berger 已提交
8
  examples/dominfo examples/domsuspend examples/python examples/apparmor \
9
  examples/xml/nwfilter examples/openauth examples/systemtap
10

11
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
12

13 14 15
XML_EXAMPLES = \
  $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/examples/xml/, \
					test/*.xml storage/*.xml)))
16

17
syntax_check_exceptions = \
C
Chris Lalancette 已提交
18
  .x-sc_avoid_ctype_macros \
19
  .x-sc_avoid_if_before_free \
C
Chris Lalancette 已提交
20
  .x-sc_avoid_write \
E
Eric Blake 已提交
21
  .x-sc_bindtextdomain \
C
Chris Lalancette 已提交
22
  .x-sc_m4_quote_check \
23 24
  .x-sc_po_check \
  .x-sc_prohibit_always_true_header_tests \
C
Chris Lalancette 已提交
25
  .x-sc_prohibit_asprintf \
E
Eric Blake 已提交
26
  .x-sc_prohibit_close \
27
  .x-sc_prohibit_empty_lines_at_EOF \
28
  .x-sc_prohibit_fork_wrappers \
C
Chris Lalancette 已提交
29
  .x-sc_prohibit_gethostby \
30
  .x-sc_prohibit_gethostname \
E
Eric Blake 已提交
31
  .x-sc_prohibit_gettext_noop \
C
Chris Lalancette 已提交
32 33 34
  .x-sc_prohibit_have_config_h \
  .x-sc_prohibit_HAVE_MBRTOWC \
  .x-sc_prohibit_nonreentrant \
35
  .x-sc_prohibit_readlink \
E
Eric Blake 已提交
36
  .x-sc_prohibit_sprintf \
C
Chris Lalancette 已提交
37
  .x-sc_prohibit_strncpy \
E
Eric Blake 已提交
38
  .x-sc_prohibit_test_minus_ao \
C
Chris Lalancette 已提交
39
  .x-sc_prohibit_VIR_ERR_NO_MEMORY \
40
  .x-sc_prohibit_xmlGetProp \
41
  .x-sc_require_config_h \
C
Chris Lalancette 已提交
42 43
  .x-sc_require_config_h_first \
  .x-sc_trailing_blank \
44 45 46 47 48 49 50 51
  .x-sc_unmarked_diagnostics

EXTRA_DIST = \
  ChangeLog-old \
  libvirt.spec libvirt.spec.in \
  mingw32-libvirt.spec.in \
  libvirt.pc libvirt.pc.in \
  autobuild.sh \
52
  Makefile.nonreentrant \
53
  autogen.sh \
54
  cfg.mk \
D
Daniel Veillard 已提交
55
  examples/domain-events/events-python \
56
  $(syntax_check_exceptions) \
57
  $(XML_EXAMPLES)
58

D
Daniel Veillard 已提交
59
pkgconfigdir = $(libdir)/pkgconfig
60
pkgconfig_DATA = libvirt.pc
D
Daniel Veillard 已提交
61

62 63 64 65 66 67 68 69
NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
	-@(if [ -x $(XSLTPROC) ] ; then				\
	  $(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl	\
	     $(top_srcdir)/docs/news.html.in			\
	   | perl -0777 -pe 's/\n\n+$$/\n/'			\
	   | perl -pe 's/[ \t]+$$//'				\
	   > $@-t && mv $@-t $@ ; fi );

70 71 72 73 74 75 76
$(top_srcdir)/HACKING: $(top_srcdir)/docs/hacking1.xsl $(top_srcdir)/docs/hacking2.xsl \
                       $(top_srcdir)/docs/wrapstring.xsl $(top_srcdir)/docs/hacking.html.in
	-@(if [ -x $(XSLTPROC) ] ; then \
	   $(XSLTPROC) --nonet $(top_srcdir)/docs/hacking1.xsl $(top_srcdir)/docs/hacking.html.in | \
	   $(XSLTPROC) --nonet $(top_srcdir)/docs/hacking2.xsl - \
	   | perl -0777 -pe 's/\n\n+$$/\n/' \
	   > $@-t && mv $@-t $@ ; fi );
77

78 79
rpm: clean
	@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
80 81 82 83

check-local: all tests

tests:
84
	@(cd docs/examples ; $(MAKE) MAKEFLAGS+=--silent tests)
J
Jim Meyering 已提交
85
	@(if [ "$(pythondir)" != "" ] ; then cd python ; \
86 87
	  $(MAKE) MAKEFLAGS+=--silent tests ; fi)

88 89
cov: clean-cov
	mkdir $(top_builddir)/coverage
90 91 92 93 94
	$(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp \
	  -d $(top_builddir)/src  -d $(top_builddir)/daemon \
	  -d $(top_builddir)/tests
	$(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp \
	  -o $(top_builddir)/coverage/libvirt.info
95
	rm $(top_builddir)/coverage/libvirt.info.tmp
96 97
	$(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \
	  --legend $(top_builddir)/coverage/libvirt.info
98 99 100

clean-cov:
	rm -rf $(top_builddir)/coverage
J
Jim Meyering 已提交
101

102 103
MAINTAINERCLEANFILES = .git-module-status

J
Jim Meyering 已提交
104 105
# disable this check
distuninstallcheck:
106 107 108 109 110 111 112 113 114 115 116 117 118 119

dist-hook: gen-ChangeLog

# Generate the ChangeLog file (with all entries since the switch to git)
# and insert it into the directory we're about to use to create a tarball.
gen_start_date = 2009-07-04
.PHONY: gen-ChangeLog
gen-ChangeLog:
	if test -d .git; then					\
	  $(top_srcdir)/build-aux/gitlog-to-changelog		\
	    --since=$(gen_start_date) > $(distdir)/cl-t;	\
	  rm -f $(distdir)/ChangeLog;				\
	  mv $(distdir)/cl-t $(distdir)/ChangeLog;		\
	fi