1 # Makefile for libvirt python library
3 ## Copyright (C) 2005-2012 Red Hat, Inc.
4 ## See COPYING.LIB for the License of this software
10 -I$(top_builddir)/gnulib/lib \
11 -I$(top_srcdir)/gnulib/lib \
12 -I$(top_builddir)/src \
14 -I$(top_srcdir)/src/util \
15 -I$(top_builddir)/include \
16 -I$(top_srcdir)/include \
19 AM_CFLAGS = $(WARN_CFLAGS)
21 DOCS_DIR = $(datadir)/doc/libvirt-python-$(VERSION)
26 libvirt-override-virConnect.py \
27 libvirt-override-virDomain.py \
28 libvirt-override-virDomainSnapshot.py \
29 libvirt-override-virStream.py
37 libvirt-override-api.xml \
38 libvirt-qemu-override.c \
39 libvirt-qemu-override-api.xml \
45 $(top_builddir)/src/libvirt.la \
46 $(top_builddir)/gnulib/lib/libgnu.la
48 $(top_builddir)/src/libvirt-qemu.la \
49 $(top_builddir)/gnulib/lib/libgnu.la
51 all-local: libvirt.py libvirt_qemu.py
53 pyexec_LTLIBRARIES = libvirtmod.la libvirtmod_qemu.la
55 libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c
56 nodist_libvirtmod_la_SOURCES = libvirt.c libvirt.h
57 # Python <= 2.4 header files contain a redundant decl, hence we
58 # need extra flags here
59 libvirtmod_la_CFLAGS = $(WARN_CFLAGS) $(WARN_PYTHON_CFLAGS)
61 libvirtmod_la_LDFLAGS = -module -avoid-version -shared -L$(top_builddir)/src/.libs \
62 $(CYGWIN_EXTRA_LDFLAGS)
63 libvirtmod_la_LIBADD = $(mylibs) \
64 $(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
66 libvirtmod_qemu_la_SOURCES = libvirt-qemu-override.c typewrappers.c
67 nodist_libvirtmod_qemu_la_SOURCES = libvirt-qemu.c libvirt-qemu.h
68 # Python <= 2.4 header files contain a redundant decl, hence we
69 # need extra flags here
70 libvirtmod_qemu_la_CFLAGS = $(WARN_PYTHON_CFLAGS)
72 libvirtmod_qemu_la_LDFLAGS = -module -avoid-version -shared -L$(top_builddir)/src/.libs \
73 $(CYGWIN_EXTRA_LDFLAGS)
74 libvirtmod_qemu_la_LIBADD = $(myqemulibs) \
75 $(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
77 GENERATE = generator.py
78 API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-override-api.xml
79 GENERATED= libvirt-export.c \
84 QEMU_API_DESC = $(top_srcdir)/docs/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-override-api.xml
85 QEMU_GENERATED= libvirt-qemu-export.c \
90 $(GENERATE).stamp: $(srcdir)/$(GENERATE) $(API_DESC) $(QEMU_API_DESC)
91 $(AM_V_GEN)$(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON) && \
94 $(GENERATED) $(QEMU_GENERATED): $(GENERATE).stamp
96 $(libvirtmod_la_OBJECTS): $(GENERATED)
97 $(libvirtmod_qemu_la_OBJECTS): $(QEMU_GENERATED)
100 $(mkinstalldirs) $(DESTDIR)$(pyexecdir)
101 $(INSTALL) -m 0644 libvirt.py $(DESTDIR)$(pyexecdir)
102 $(INSTALL) -m 0644 libvirt_qemu.py $(DESTDIR)$(pyexecdir)
103 $(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
104 @(for doc in $(DOCS) ; \
105 do $(INSTALL) -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
108 rm -f $(DESTDIR)$(pyexecdir)/libvirt.py
109 rm -f $(DESTDIR)$(pyexecdir)/libvirt_qemu.py
111 CLEANFILES= $(GENERATED) $(QEMU_GENERATED) $(GENERATE).stamp
119 tests test: all dummy
120 -@(cd tests && $(MAKE) MAKEFLAGS+=--silent tests)