Makefile.am 1.8 KB
Newer Older
1
# Makefile for libvirt python library
2

3
SUBDIRS= . tests
4

5
INCLUDES = \
6
        $(WARN_CFLAGS) \
7
        $(PYTHON_INCLUDES) \
8 9 10 11
	-I$(top_srcdir)/include \
	-I$(top_builddir)/include \
	-I$(top_builddir)/$(subdir)

12
DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
13 14 15

DOCS = ${srcdir}/TODO

16 17 18
CLASSES_EXTRA = \
	libvirt-override-virConnect.py \
	libvirt-override-virStream.py
19 20 21 22 23 24 25 26

EXTRA_DIST =			\
	generator.py		\
	typewrappers.c		\
	typewrappers.h		\
	libvirt-override.c	\
	libvirt-override.py	\
	libvirt-override-api.xml \
27
	$(CLASSES_EXTRA) \
28 29 30
	$(DOCS)

if WITH_PYTHON
31
mylibs = $(top_builddir)/src/libvirt.la
32

33
all-local: libvirt.py
34

35
python_LTLIBRARIES = libvirtmod.la
36

37
libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c libvirt.c libvirt.h
38 39 40
# Python <= 2.4 header files contain a redundant decl, hence we
# need extra flags here
libvirtmod_la_CFLAGS = @WARN_PYTHON_CFLAGS@
41

42 43 44 45 46
libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs \
	@CYGWIN_EXTRA_LDFLAGS@
libvirtmod_la_LIBADD = $(mylibs) \
	@CYGWIN_EXTRA_LIBADD@ @CYGWIN_EXTRA_PYTHON_LIBADD@

47
GENERATE = generator.py
48
API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-override-api.xml
49
GENERATED= libvirt-export.c \
50 51 52
	   libvirt.c \
	   libvirt.h \
	   libvirt.py
53

54
generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC)
55
	$(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
56 57 58
	touch $@

$(GENERATED): generated.stamp
59

60
$(libvirtmod_la_OBJECTS): $(GENERATED)
61

62 63 64 65 66 67 68
install-data-local:
	$(mkinstalldirs) $(DESTDIR)$(pythondir)
	@INSTALL@ -m 0644 libvirt.py $(DESTDIR)$(pythondir)
	$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
	@(for doc in $(DOCS) ; \
	   do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)

J
Jim Meyering 已提交
69 70 71
uninstall-local:
	rm -f $(DESTDIR)$(pythondir)/libvirt.py

72
CLEANFILES= $(GENERATED) generated.stamp
73

74
else
75
all:
76
endif
77 78 79 80 81

dummy:

tests test: all dummy
	-@(cd tests && $(MAKE) MAKEFLAGS+=--silent tests)