2006-02-09 20:45:11 +03:00
# Makefile for libvirt python library
2005-12-19 19:34:11 +03:00
2011-07-28 22:56:24 +04:00
## Copyright (C) 2005-2011 Red Hat, Inc.
## See COPYING.LIB for the License of this software
2006-02-15 16:21:17 +03:00
SUBDIRS = . tests
2006-02-14 17:30:42 +03:00
2005-12-19 19:34:11 +03:00
INCLUDES = \
build: consistently use CFLAGS
According to the automake manual, CPPFLAGS (aka INCLUDES, as spelled
in automake 1.9.6) should only include -I, -D, and -U directives; more
generic directives like -Wall belong in CFLAGS since they affect more
phases of the build process. Therefore, we should be sticking CFLAGS
additions into a CFLAGS container, not a CPPFLAGS container.
* src/Makefile.am (libvirt_driver_vmware_la_CFLAGS): Use AM_CFLAGS.
(INCLUDES): Move CFLAGS items...
(AM_CFLAGS): ...to their proper location.
* python/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
* tests/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
(commandtest_CFLAGS, commandhelper_CFLAGS)
(virnetmessagetest_CFLAGS, virnetsockettest_CFLAGS): Use AM_CFLAGS.
2011-06-01 02:15:28 +04:00
$( PYTHON_INCLUDES) \
2005-12-19 19:34:11 +03:00
-I$( top_srcdir) /include \
-I$( top_builddir) /include \
2011-07-28 16:55:21 +04:00
-I$( top_builddir) /$( subdir) \
$( GETTEXT_CPPFLAGS)
2005-12-19 19:34:11 +03:00
build: consistently use CFLAGS
According to the automake manual, CPPFLAGS (aka INCLUDES, as spelled
in automake 1.9.6) should only include -I, -D, and -U directives; more
generic directives like -Wall belong in CFLAGS since they affect more
phases of the build process. Therefore, we should be sticking CFLAGS
additions into a CFLAGS container, not a CPPFLAGS container.
* src/Makefile.am (libvirt_driver_vmware_la_CFLAGS): Use AM_CFLAGS.
(INCLUDES): Move CFLAGS items...
(AM_CFLAGS): ...to their proper location.
* python/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
* tests/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
(commandtest_CFLAGS, commandhelper_CFLAGS)
(virnetmessagetest_CFLAGS, virnetsockettest_CFLAGS): Use AM_CFLAGS.
2011-06-01 02:15:28 +04:00
AM_CFLAGS = $( WARN_CFLAGS)
2006-02-15 16:21:17 +03:00
DOCS_DIR = $( datadir) /doc/libvirt-python-$( LIBVIRT_VERSION)
2005-12-19 19:34:11 +03:00
DOCS = ${ srcdir } /TODO
2009-07-10 15:18:12 +04:00
CLASSES_EXTRA = \
libvirt-override-virConnect.py \
libvirt-override-virStream.py
2009-09-16 17:03:53 +04:00
EXTRA_DIST = \
generator.py \
typewrappers.c \
typewrappers.h \
libvirt-override.c \
libvirt-override.py \
libvirt-override-api.xml \
2011-09-09 15:10:43 +04:00
libvirt-qemu-override.c \
libvirt-qemu-override-api.xml \
2008-10-31 13:13:45 +03:00
$( CLASSES_EXTRA) \
2005-12-19 19:34:11 +03:00
$( DOCS)
i f W I T H _ P Y T H O N
2006-02-09 20:45:11 +03:00
mylibs = $( top_builddir) /src/libvirt.la
2011-09-09 15:10:43 +04:00
myqemulibs = $( top_builddir) /src/libvirt-qemu.la
2005-12-19 19:34:11 +03:00
2011-09-09 15:10:43 +04:00
all-local : libvirt .py libvirt_qemu .py
2005-12-19 19:34:11 +03:00
2011-09-09 15:10:43 +04:00
pyexec_LTLIBRARIES = libvirtmod.la libvirtmod_qemu.la
2005-12-19 19:34:11 +03:00
2010-04-15 14:49:33 +04:00
libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c
nodist_libvirtmod_la_SOURCES = libvirt.c libvirt.h
2008-12-18 15:20:00 +03:00
# Python <= 2.4 header files contain a redundant decl, hence we
# need extra flags here
2010-01-15 13:09:01 +03:00
libvirtmod_la_CFLAGS = $( WARN_PYTHON_CFLAGS)
2005-12-19 19:34:11 +03:00
2010-01-06 19:33:41 +03:00
libvirtmod_la_LDFLAGS = -module -avoid-version -shared -L$( top_builddir) /src/.libs \
2010-01-15 13:09:01 +03:00
$( CYGWIN_EXTRA_LDFLAGS)
2007-11-29 20:44:01 +03:00
libvirtmod_la_LIBADD = $( mylibs) \
2010-01-15 13:09:01 +03:00
$( CYGWIN_EXTRA_LIBADD) $( CYGWIN_EXTRA_PYTHON_LIBADD)
2007-11-29 20:44:01 +03:00
2011-09-09 15:10:43 +04:00
libvirtmod_qemu_la_SOURCES = libvirt-qemu-override.c typewrappers.c
nodist_libvirtmod_qemu_la_SOURCES = libvirt-qemu.c libvirt-qemu.h
# Python <= 2.4 header files contain a redundant decl, hence we
# need extra flags here
libvirtmod_qemu_la_CFLAGS = $( WARN_PYTHON_CFLAGS)
libvirtmod_qemu_la_LDFLAGS = -module -avoid-version -shared -L$( top_builddir) /src/.libs \
$( CYGWIN_EXTRA_LDFLAGS)
libvirtmod_qemu_la_LIBADD = $( myqemulibs) \
$( CYGWIN_EXTRA_LIBADD) $( CYGWIN_EXTRA_PYTHON_LIBADD)
2005-12-19 19:34:11 +03:00
GENERATE = generator.py
2009-09-16 17:03:53 +04:00
API_DESC = $( top_srcdir) /docs/libvirt-api.xml $( srcdir) /libvirt-override-api.xml
2007-06-26 17:47:04 +04:00
GENERATED = libvirt-export.c \
2009-09-16 17:03:53 +04:00
libvirt.c \
libvirt.h \
libvirt.py
2005-12-19 19:34:11 +03:00
2011-09-09 15:10:43 +04:00
QEMU_API_DESC = $( top_srcdir) /docs/libvirt-qemu-api.xml $( srcdir) /libvirt-qemu-override-api.xml
QEMU_GENERATED = libvirt-qemu-export.c \
libvirt-qemu.c \
libvirt-qemu.h \
libvirt_qemu.py
$(GENERATE).stamp : $( srcdir ) /$( GENERATE ) $( API_DESC ) $( QEMU_API_DESC )
2011-05-12 14:19:42 +04:00
$( AM_V_GEN) $( PYTHON) $( srcdir) /$( GENERATE) $( PYTHON) && \
2009-02-26 16:58:35 +03:00
touch $@
2011-09-09 15:10:43 +04:00
$(GENERATED) $(QEMU_GENERATED) : $( GENERATE ) .stamp
2007-06-26 17:47:04 +04:00
2006-02-09 20:45:11 +03:00
$(libvirtmod_la_OBJECTS) : $( GENERATED )
2011-09-09 15:10:43 +04:00
$(libvirtmod_qemu_la_OBJECTS) : $( QEMU_GENERATED )
2005-12-19 19:34:11 +03:00
2007-06-26 17:47:04 +04:00
install-data-local :
2009-12-12 02:11:31 +03:00
$( mkinstalldirs) $( DESTDIR) $( pyexecdir)
2010-01-15 13:09:01 +03:00
$( INSTALL) -m 0644 libvirt.py $( DESTDIR) $( pyexecdir)
2011-09-09 15:10:43 +04:00
$( INSTALL) -m 0644 libvirt_qemu.py $( DESTDIR) $( pyexecdir)
2007-06-26 17:47:04 +04:00
$( mkinstalldirs) $( DESTDIR) $( DOCS_DIR)
@( for doc in $( DOCS) ; \
2010-01-15 13:09:01 +03:00
do $( INSTALL) -m 0644 $$ doc $( DESTDIR) $( DOCS_DIR) ; done )
2007-06-26 17:47:04 +04:00
2007-11-15 16:04:28 +03:00
uninstall-local :
2009-12-12 02:11:31 +03:00
rm -f $( DESTDIR) $( pyexecdir) /libvirt.py
2011-09-09 15:10:43 +04:00
rm -f $( DESTDIR) $( pyexecdir) /libvirt_qemu.py
2007-11-15 16:04:28 +03:00
2011-09-09 15:10:43 +04:00
CLEANFILES = $( GENERATED) $( QEMU_GENERATED) $( GENERATE) .stamp
2007-06-26 17:47:04 +04:00
2005-12-19 19:34:11 +03:00
e l s e
2008-02-05 22:27:37 +03:00
all :
2005-12-19 19:34:11 +03:00
e n d i f
2006-02-14 17:30:42 +03:00
dummy :
tests test : all dummy
-@( cd tests && $( MAKE) MAKEFLAGS += --silent tests)