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

3
SUBDIRS= . tests
4

5
INCLUDES = \
6
        $(WARN_CFLAGS) \
7 8 9 10 11
        -I$(PYTHON_INCLUDES) \
	-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
CLASSES_EXTRA = virConnect.py

18 19 20 21
EXTRA_DIST =		\
	libvir.c	\
	types.c		\
	generator.py	\
22 23
	libvirt_wrap.h	\
	libvirt.py	\
D
Daniel Veillard 已提交
24
	libvir.py	\
25
	libvirt-python-api.xml \
26
	$(CLASSES_EXTRA) \
27 28 29
	$(DOCS)

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

32
all-local: libvirt.py
33

34
python_LTLIBRARIES = libvirtmod.la
35

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

41 42 43 44 45
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@

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

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

$(GENERATED): generated.stamp
59

60
libvirt.py: $(srcdir)/libvir.py $(GENERATED) $(CLASSES_EXTRA)
J
Jim Meyering 已提交
61 62
	cat $(srcdir)/libvir.py libvirtclass.py > $@-t
	mv $@-t $@
63

64
$(libvirtmod_la_OBJECTS): $(GENERATED)
65

66 67 68 69 70 71 72
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 已提交
73 74 75
uninstall-local:
	rm -f $(DESTDIR)$(pythondir)/libvirt.py

76
CLEANFILES= $(GENERATED) generated.stamp libvirt.py
77

78
else
79
all:
80
endif
81 82 83 84 85

dummy:

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