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

3
SUBDIRS= . tests
4

5
INCLUDES = \
E
Eric Blake 已提交
6
	$(PYTHON_INCLUDES) \
7 8 9 10
	-I$(top_srcdir)/include \
	-I$(top_builddir)/include \
	-I$(top_builddir)/$(subdir)

E
Eric Blake 已提交
11 12
AM_CFLAGS = $(WARN_CFLAGS)

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

DOCS = ${srcdir}/TODO

17 18 19
CLASSES_EXTRA = \
	libvirt-override-virConnect.py \
	libvirt-override-virStream.py
20 21 22 23 24 25 26 27

EXTRA_DIST =			\
	generator.py		\
	typewrappers.c		\
	typewrappers.h		\
	libvirt-override.c	\
	libvirt-override.py	\
	libvirt-override-api.xml \
28
	$(CLASSES_EXTRA) \
29 30 31
	$(DOCS)

if WITH_PYTHON
32
mylibs = $(top_builddir)/src/libvirt.la
33

34
all-local: libvirt.py
35

36
pyexec_LTLIBRARIES = libvirtmod.la
37

38 39
libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c
nodist_libvirtmod_la_SOURCES = libvirt.c libvirt.h
40 41
# Python <= 2.4 header files contain a redundant decl, hence we
# need extra flags here
42
libvirtmod_la_CFLAGS = $(WARN_PYTHON_CFLAGS)
43

44
libvirtmod_la_LDFLAGS = -module -avoid-version -shared -L$(top_builddir)/src/.libs \
45
	$(CYGWIN_EXTRA_LDFLAGS)
46
libvirtmod_la_LIBADD = $(mylibs) \
47
	$(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
48

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

56 57
$(GENERATE).stamp: $(srcdir)/$(GENERATE) $(API_DESC)
	$(AM_V_GEN)$(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON) && \
58 59
	touch $@

60
$(GENERATED): $(GENERATE).stamp
61

62
$(libvirtmod_la_OBJECTS): $(GENERATED)
63

64
install-data-local:
65
	$(mkinstalldirs) $(DESTDIR)$(pyexecdir)
66
	$(INSTALL) -m 0644 libvirt.py $(DESTDIR)$(pyexecdir)
67 68
	$(mkinstalldirs) $(DESTDIR)$(DOCS_DIR)
	@(for doc in $(DOCS) ; \
69
	   do $(INSTALL) -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
70

J
Jim Meyering 已提交
71
uninstall-local:
72
	rm -f $(DESTDIR)$(pyexecdir)/libvirt.py
J
Jim Meyering 已提交
73

74
CLEANFILES= $(GENERATED) generated.stamp
75

76
else
77
all:
78
endif
79 80 81 82 83

dummy:

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