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

D
Daniel Veillard 已提交
40 41
libvirt.py: $(srcdir)/libvir.py libvirtclass.py
	cat $(srcdir)/libvir.py libvirtclass.py > libvirt.py
42 43 44

install-data-local:
	$(mkinstalldirs) $(DESTDIR)$(pythondir)
45
	@INSTALL@ -m 0644 libvirt.py $(DESTDIR)$(pythondir)
46 47 48 49 50
	$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
	@(for doc in $(DOCS) ; \
	   do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)

GENERATE = generator.py
51 52 53 54 55
API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-python-api.xml
GENERATED= libvirt.py \
           libvirt-export.c \
           libvirtclass.txt \
	   libvirt-py.c \
56 57
	   libvirt-py.h \
	   libvirtclass.py
58

59
CLEANFILES= $(GENERATED) gen_prog libvirt.py
60 61 62 63 64 65 66

$(GENERATED): gen_prog

gen_prog: $(srcdir)/$(GENERATE) $(API_DESC)
	$(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
	touch gen_prog

67
$(libvirtmod_la_OBJECTS): $(GENERATED)
68 69 70 71

else
all: 
endif
72 73 74 75 76

dummy:

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