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

3
## Copyright (C) 2005-2012 Red Hat, Inc.
4 5
## See COPYING.LIB for the License of this software

6 7 8
LCOV = lcov
GENHTML = genhtml

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

14
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
15

16 17 18
XML_EXAMPLES = \
  $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/examples/xml/, \
					test/*.xml storage/*.xml)))
19

20 21
EXTRA_DIST = \
  ChangeLog-old \
22
  libvirt.spec libvirt.spec.in \
23
  mingw-libvirt.spec.in \
24
  libvirt.pc.in \
25
  autobuild.sh \
26
  Makefile.nonreentrant \
27
  autogen.sh \
28
  cfg.mk \
D
Daniel Veillard 已提交
29
  examples/domain-events/events-python \
30
  run.in \
C
Cole Robinson 已提交
31
  AUTHORS.in \
32
  $(XML_EXAMPLES)
33

D
Daniel Veillard 已提交
34
pkgconfigdir = $(libdir)/pkgconfig
35
pkgconfig_DATA = libvirt.pc
D
Daniel Veillard 已提交
36

37
NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
38
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then			\
39 40 41 42
	  $(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl	\
	     $(top_srcdir)/docs/news.html.in			\
	   | perl -0777 -pe 's/\n\n+$$/\n/'			\
	   | perl -pe 's/[ \t]+$$//'				\
43
	   > $@-t && mv $@-t $@ ; fi
44

45 46
$(top_srcdir)/HACKING: $(top_srcdir)/docs/hacking1.xsl $(top_srcdir)/docs/hacking2.xsl \
                       $(top_srcdir)/docs/wrapstring.xsl $(top_srcdir)/docs/hacking.html.in
47
	$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
48 49 50
	   $(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/' \
51
	   > $@-t && mv $@-t $@ ; fi;
52

53 54
rpm: clean
	@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
55 56 57 58

check-local: all tests

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

63 64
cov: clean-cov
	mkdir $(top_builddir)/coverage
65 66 67 68 69
	$(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
70
	rm $(top_builddir)/coverage/libvirt.info.tmp
71 72
	$(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \
	  --legend $(top_builddir)/coverage/libvirt.info
73 74 75

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

77 78
MAINTAINERCLEANFILES = .git-module-status

J
Jim Meyering 已提交
79 80
# disable this check
distuninstallcheck:
81

C
Cole Robinson 已提交
82
dist-hook: gen-ChangeLog gen-AUTHORS
83 84 85 86 87 88

# 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:
89
	$(AM_V_GEN)if test -d .git; then			\
90 91 92 93 94
	  $(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
C
Cole Robinson 已提交
95 96 97

.PHONY: gen-AUTHORS
gen-AUTHORS:
98
	$(AM_V_GEN)if test -d .git; then \
C
Cole Robinson 已提交
99 100 101 102 103
	    out="`git log --pretty=format:'%aN <%aE>' | sort -u`" && \
	    cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#/$$out/" > \
	      $(distdir)/AUTHORS-tmp && \
	    mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ; \
	fi