Makefile.am 1.7 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
	$(DOCS)

26
libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs
27 28

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

31
all-local: libvirt.py
32

33
python_LTLIBRARIES = libvirtmod.la
34

35
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h
36 37 38
libvirtmod_la_LIBADD = $(mylibs)
# Python header files contain a redundant decl, hence:
libvirtmod_la_CFLAGS = -Wno-redundant-decls
39 40

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

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

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

55
$(libvirtmod_la_OBJECTS): $(GENERATED)
56

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

67 68
CLEANFILES= $(GENERATED) libvirt.py

69 70 71
else
all: 
endif
72 73 74 75 76

dummy:

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