From a9ea906035bcf5cbe95db64f51ed2ff7cec2b503 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 16 Sep 2009 14:03:53 +0100 Subject: 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 --- Makefile.am | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index a7c342e..95ae84d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,16 +13,15 @@ DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION) DOCS = ${srcdir}/TODO -CLASSES_EXTRA = virConnect.py - -EXTRA_DIST = \ - libvir.c \ - types.c \ - generator.py \ - libvirt_wrap.h \ - libvirt.py \ - libvir.py \ - libvirt-python-api.xml \ +CLASSES_EXTRA = libvirt-override-virConnect.py + +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: -- cgit