Makefile.am 1.6 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 36
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h
libvirtmod_la_LIBADD = $(mylibs) 
37

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

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

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

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

$(GENERATED): gen_prog

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

65
$(libvirtmod_la_OBJECTS): $(GENERATED)
66 67 68 69

else
all: 
endif
70 71 72 73 74

dummy:

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