Re-arrange python generator to make it clear what's auto-generated

* README: New file describing what each file is used for
* livvirt-override.c, libvirt-override.py, libvirt-override-api.xml,
  libvirt-override-virConnect.py: Manually written code overriding
  the generator
* typewrappers.c, typewrappers.h: Data type wrappers
* generator.py: Automatically pre-prend contents of libvirt-override.py
  to generated libvirt.py. Output into libvirt.py directly instead of
  libvirtclass.py. Don't generate libvirtclass.txt at all. Write C
  files into libvirt.c/.h directly
* Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py
  and libvirtclass.py, since generator.py does it directly
This commit is contained in:
Daniel P. Berrange
2009-09-16 14:03:53 +01:00
parent 81c28325aa
commit f991a00653
10 changed files with 78 additions and 69 deletions

View File

@@ -13,16 +13,15 @@ DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
DOCS = ${srcdir}/TODO
CLASSES_EXTRA = virConnect.py
CLASSES_EXTRA = libvirt-override-virConnect.py
EXTRA_DIST = \
libvir.c \
types.c \
generator.py \
libvirt_wrap.h \
libvirt.py \
libvir.py \
libvirt-python-api.xml \
EXTRA_DIST = \
generator.py \
typewrappers.c \
typewrappers.h \
libvirt-override.c \
libvirt-override.py \
libvirt-override-api.xml \
$(CLASSES_EXTRA) \
$(DOCS)
@@ -33,7 +32,7 @@ all-local: libvirt.py
python_LTLIBRARIES = libvirtmod.la
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h
libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c libvirt.c libvirt.h
# Python <= 2.4 header files contain a redundant decl, hence we
# need extra flags here
libvirtmod_la_CFLAGS = @WARN_PYTHON_CFLAGS@
@@ -44,12 +43,11 @@ libvirtmod_la_LIBADD = $(mylibs) \
@CYGWIN_EXTRA_LIBADD@ @CYGWIN_EXTRA_PYTHON_LIBADD@
GENERATE = generator.py
API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-python-api.xml
API_DESC = $(top_srcdir)/docs/libvirt-api.xml $(srcdir)/libvirt-override-api.xml
GENERATED= libvirt-export.c \
libvirtclass.txt \
libvirt-py.c \
libvirt-py.h \
libvirtclass.py
libvirt.c \
libvirt.h \
libvirt.py
generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC)
$(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
@@ -57,10 +55,6 @@ generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC)
$(GENERATED): generated.stamp
libvirt.py: $(srcdir)/libvir.py $(GENERATED) $(CLASSES_EXTRA)
cat $(srcdir)/libvir.py libvirtclass.py > $@-t
mv $@-t $@
$(libvirtmod_la_OBJECTS): $(GENERATED)
install-data-local:
@@ -73,7 +67,7 @@ install-data-local:
uninstall-local:
rm -f $(DESTDIR)$(pythondir)/libvirt.py
CLEANFILES= $(GENERATED) generated.stamp libvirt.py
CLEANFILES= $(GENERATED) generated.stamp
else
all: