Makefile.am 1.8 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 16 17 18 19

DOCS = ${srcdir}/TODO

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

if WITH_PYTHON
27
mylibs = $(top_builddir)/src/libvirt.la
28

29
all-local: libvirt.py
30

31
python_LTLIBRARIES = libvirtmod.la
32

33
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h
34 35
# Python header files contain a redundant decl, hence:
libvirtmod_la_CFLAGS = -Wno-redundant-decls
36

37 38 39 40 41
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@

42
GENERATE = generator.py
43
API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-python-api.xml
44
GENERATED= libvirt-export.c \
45 46
           libvirtclass.txt \
	   libvirt-py.c \
47 48
	   libvirt-py.h \
	   libvirtclass.py
49

50
$(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC)
51
	$(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
52

53
libvirt.py: $(srcdir)/libvir.py $(GENERATED)
J
Jim Meyering 已提交
54 55
	cat $(srcdir)/libvir.py libvirtclass.py > $@-t
	mv $@-t $@
56

57
$(libvirtmod_la_OBJECTS): $(GENERATED)
58

59 60 61 62 63 64 65
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 已提交
66 67 68
uninstall-local:
	rm -f $(DESTDIR)$(pythondir)/libvirt.py

69 70
CLEANFILES= $(GENERATED) libvirt.py

71
else
72
all:
73
endif
74 75 76 77 78

dummy:

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