1 # Makefile for libvirt python library
8 -I$(top_srcdir)/include \
9 -I$(top_builddir)/include \
10 -I$(top_builddir)/$(subdir)
12 DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
16 CLASSES_EXTRA = virConnect.py
25 libvirt-python-api.xml \
30 mylibs = $(top_builddir)/src/libvirt.la
34 python_LTLIBRARIES = libvirtmod.la
36 libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h
37 # Python <= 2.4 header files contain a redundant decl, hence we
38 # need extra flags here
39 libvirtmod_la_CFLAGS = @WARN_PYTHON_CFLAGS@
41 libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs \
42 @CYGWIN_EXTRA_LDFLAGS@
43 libvirtmod_la_LIBADD = $(mylibs) \
44 @CYGWIN_EXTRA_LIBADD@ @CYGWIN_EXTRA_PYTHON_LIBADD@
46 GENERATE = generator.py
47 API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-python-api.xml
48 GENERATED= libvirt-export.c \
54 generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC)
55 $(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
58 $(GENERATED): generated.stamp
60 libvirt.py: $(srcdir)/libvir.py $(GENERATED) $(CLASSES_EXTRA)
61 cat $(srcdir)/libvir.py libvirtclass.py > $@-t
64 $(libvirtmod_la_OBJECTS): $(GENERATED)
67 $(mkinstalldirs) $(DESTDIR)$(pythondir)
68 @INSTALL@ -m 0644 libvirt.py $(DESTDIR)$(pythondir)
69 $(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
70 @(for doc in $(DOCS) ; \
71 do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
74 rm -f $(DESTDIR)$(pythondir)/libvirt.py
76 CLEANFILES= $(GENERATED) generated.stamp libvirt.py
85 -@(cd tests && $(MAKE) MAKEFLAGS+=--silent tests)