2006-02-10 01:45:11 +08:00
|
|
|
# Makefile for libvirt python library
|
2005-12-20 00:34:11 +08:00
|
|
|
|
2006-02-15 21:21:17 +08:00
|
|
|
SUBDIRS= . tests
|
2006-02-14 22:30:42 +08:00
|
|
|
|
2005-12-20 00:34:11 +08:00
|
|
|
INCLUDES = \
|
|
|
|
-I$(PYTHON_INCLUDES) \
|
|
|
|
-I$(top_srcdir)/include \
|
|
|
|
-I$(top_builddir)/include \
|
|
|
|
-I$(top_builddir)/$(subdir)
|
|
|
|
|
2006-02-15 21:21:17 +08:00
|
|
|
DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
|
2005-12-20 00:34:11 +08:00
|
|
|
|
|
|
|
DOCS = ${srcdir}/TODO
|
|
|
|
|
|
|
|
EXTRA_DIST = \
|
|
|
|
libvir.c \
|
|
|
|
types.c \
|
|
|
|
generator.py \
|
2006-02-10 01:45:11 +08:00
|
|
|
libvirt_wrap.h \
|
|
|
|
libvirt.py \
|
2006-02-28 20:17:00 +08:00
|
|
|
libvir.py \
|
2006-02-10 01:45:11 +08:00
|
|
|
libvirt-python-api.xml \
|
2005-12-20 00:34:11 +08:00
|
|
|
$(DOCS)
|
|
|
|
|
2006-02-10 01:45:11 +08:00
|
|
|
libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs
|
2005-12-20 00:34:11 +08:00
|
|
|
|
|
|
|
if WITH_PYTHON
|
2006-02-10 01:45:11 +08:00
|
|
|
mylibs = $(top_builddir)/src/libvirt.la
|
2005-12-20 00:34:11 +08:00
|
|
|
|
2006-02-10 01:45:11 +08:00
|
|
|
all-local: libvirt.py
|
2005-12-20 00:34:11 +08:00
|
|
|
|
2006-02-10 01:45:11 +08:00
|
|
|
python_LTLIBRARIES = libvirtmod.la
|
2005-12-20 00:34:11 +08:00
|
|
|
|
2006-02-10 01:45:11 +08:00
|
|
|
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h
|
|
|
|
libvirtmod_la_LIBADD = $(mylibs)
|
2005-12-20 00:34:11 +08:00
|
|
|
|
2006-02-28 20:17:00 +08:00
|
|
|
libvirt.py: $(srcdir)/libvir.py libvirtclass.py
|
|
|
|
cat $(srcdir)/libvir.py libvirtclass.py > libvirt.py
|
2005-12-20 00:34:11 +08:00
|
|
|
|
|
|
|
install-data-local:
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(pythondir)
|
2006-02-10 01:45:11 +08:00
|
|
|
@INSTALL@ -m 0644 libvirt.py $(DESTDIR)$(pythondir)
|
2005-12-20 00:34:11 +08:00
|
|
|
$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
|
|
|
|
@(for doc in $(DOCS) ; \
|
|
|
|
do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
|
|
|
|
|
|
|
|
GENERATE = generator.py
|
2006-02-10 01:45:11 +08:00
|
|
|
API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-python-api.xml
|
|
|
|
GENERATED= libvirt.py \
|
|
|
|
libvirt-export.c \
|
|
|
|
libvirtclass.txt \
|
|
|
|
libvirt-py.c \
|
2006-02-28 22:22:33 +08:00
|
|
|
libvirt-py.h \
|
|
|
|
libvirtclass.py
|
2005-12-20 00:34:11 +08:00
|
|
|
|
2006-02-10 01:45:11 +08:00
|
|
|
CLEANFILES= $(GENERATED) gen_prog libvirt.py
|
2005-12-20 00:34:11 +08:00
|
|
|
|
|
|
|
$(GENERATED): gen_prog
|
|
|
|
|
|
|
|
gen_prog: $(srcdir)/$(GENERATE) $(API_DESC)
|
|
|
|
$(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
|
|
|
|
touch gen_prog
|
|
|
|
|
2006-02-10 01:45:11 +08:00
|
|
|
$(libvirtmod_la_OBJECTS): $(GENERATED)
|
2005-12-20 00:34:11 +08:00
|
|
|
|
|
|
|
else
|
|
|
|
all:
|
|
|
|
endif
|
2006-02-14 22:30:42 +08:00
|
|
|
|
|
|
|
dummy:
|
|
|
|
|
|
|
|
tests test: all dummy
|
|
|
|
-@(cd tests && $(MAKE) MAKEFLAGS+=--silent tests)
|