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

3 4
SUBRIRS= . tests

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-$(LIBVIR_VERSION)
12 13 14 15 16 17 18

DOCS = ${srcdir}/TODO

EXTRA_DIST =		\
	libvir.c	\
	types.c		\
	generator.py	\
19 20 21
	libvirt_wrap.h	\
	libvirt.py	\
	libvirt-python-api.xml \
22 23
	$(DOCS)

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

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

29
all-local: libvirt.py
30

31
python_LTLIBRARIES = libvirtmod.la
32

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


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

GENERATE = generator.py
45 46 47 48 49 50
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
51

52
CLEANFILES= $(GENERATED) gen_prog libvirt.py
53 54 55 56 57 58 59

$(GENERATED): gen_prog

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

60
$(libvirtmod_la_OBJECTS): $(GENERATED)
61 62 63 64

else
all: 
endif
65 66 67 68 69

dummy:

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