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

3
SUBDIRS= . tests
4

5 6 7 8 9 10
INCLUDES = \
        -I$(PYTHON_INCLUDES) \
	-I$(top_srcdir)/include \
	-I$(top_builddir)/include \
	-I$(top_builddir)/$(subdir)

11
DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
12 13 14 15 16 17 18

DOCS = ${srcdir}/TODO

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

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

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

30
all-local: libvirt.py
31

32
python_LTLIBRARIES = libvirtmod.la
33

34 35
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h
libvirtmod_la_LIBADD = $(mylibs) 
36

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

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

GENERATE = generator.py
48 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 \
	   libvirt-py.h
54

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

$(GENERATED): gen_prog

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

63
$(libvirtmod_la_OBJECTS): $(GENERATED)
64 65 66 67

else
all: 
endif
68 69 70 71 72

dummy:

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