version 1.1.1.1, 2012/02/21 23:37:59
|
version 1.1.1.2, 2014/06/15 19:53:36
|
Line 13 sys.path.insert(0, "..")
|
Line 13 sys.path.insert(0, "..")
|
from apibuild import CParser, escape |
from apibuild import CParser, escape |
|
|
examples = [] |
examples = [] |
extras = ['examples.xsl', 'index.py'] | extras = ['examples.xsl', 'index.html', 'index.py'] |
tests = [] |
tests = [] |
sections = {} |
sections = {} |
symbols = {} |
symbols = {} |
Line 177 def parse(filename, output):
|
Line 177 def parse(filename, output):
|
type = id.get_type() |
type = id.get_type() |
output.write(" <%s line='%d' name='%s'/>\n" % (type, |
output.write(" <%s line='%d' name='%s'/>\n" % (type, |
line, name)) |
line, name)) |
| |
output.write(" </uses>\n") |
output.write(" </uses>\n") |
output.write(" </example>\n") |
output.write(" </example>\n") |
| |
return idx |
return idx |
|
|
def dump_symbols(output): |
def dump_symbols(output): |
Line 220 def dump_Makefile():
|
Line 220 def dump_Makefile():
|
extras.append(file) |
extras.append(file) |
for file in glob.glob('*.res'): |
for file in glob.glob('*.res'): |
extras.append(file) |
extras.append(file) |
Makefile="""# Beware this is autogenerated by index.py | Makefile="""## |
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ | ## This file is auto-generated by index.py |
DEPS = $(top_builddir)/libxml2.la | ## DO NOT EDIT !!! |
LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ | ## |
|
|
|
AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include |
|
AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) |
|
LDADD = $(RDL_LIBS) $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD) |
|
|
|
CLEANFILES = *.tmp |
|
|
|
if REBUILD_DOCS |
rebuild: examples.xml index.html |
rebuild: examples.xml index.html |
|
.PHONY: rebuild |
|
|
examples.xml: index.py *.c | examples.xml: index.py $(noinst_PROGRAMS:=.c) |
-@($(srcdir)/index.py) | cd $(srcdir) && $(PYTHON) index.py |
| $(MAKE) Makefile |
|
|
index.html: examples.xml examples.xsl |
index.html: examples.xml examples.xsl |
-@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html) | cd $(srcdir) && xsltproc examples.xsl examples.xml && echo "Rebuilt web page" |
| -cd $(srcdir) && xmllint --valid --noout index.html |
| endif |
|
|
install-data-local: |
install-data-local: |
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR) | $(MKDIR_P) $(DESTDIR)$(HTML_DIR) |
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) | -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) |
|
|
|
clean-local: |
|
test -f Makefile.am || rm -f test?.xml |
|
|
""" |
""" |
|
examples.sort() |
|
extras.sort() |
|
tests.sort() |
EXTRA_DIST="" |
EXTRA_DIST="" |
for extra in extras: |
for extra in extras: |
EXTRA_DIST = EXTRA_DIST + extra + " " | EXTRA_DIST = EXTRA_DIST + " \\\n\t" + extra |
Makefile = Makefile + "EXTRA_DIST=%s\n\n" % (EXTRA_DIST) | Makefile = Makefile + "EXTRA_DIST =%s\n\n" % (EXTRA_DIST) |
noinst_PROGRAMS="" |
noinst_PROGRAMS="" |
for example in examples: |
for example in examples: |
noinst_PROGRAMS = noinst_PROGRAMS + example + " " | noinst_PROGRAMS = noinst_PROGRAMS + " \\\n\t" + example |
Makefile = Makefile + "noinst_PROGRAMS=%s\n\n" % (noinst_PROGRAMS) | Makefile = Makefile + "noinst_PROGRAMS =%s\n\n" % (noinst_PROGRAMS) |
for example in examples: |
for example in examples: |
Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= @RDL_LIBS@ $(LDADDS)\n\n" % (example, example, example, | Makefile = Makefile + "%s_SOURCES = %s.c\n\n" % (example, example) |
example, example) | |
Makefile = Makefile + "valgrind: \n\t$(MAKE) CHECKER='valgrind' tests\n\n" |
Makefile = Makefile + "valgrind: \n\t$(MAKE) CHECKER='valgrind' tests\n\n" |
Makefile = Makefile + "tests: $(noinst_PROGRAMS)\n" |
Makefile = Makefile + "tests: $(noinst_PROGRAMS)\n" |
|
Makefile = Makefile + "\ttest -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml .\n" |
Makefile = Makefile + "\t@(echo '## examples regression tests')\n" |
Makefile = Makefile + "\t@(echo '## examples regression tests')\n" |
Makefile = Makefile + "\t@(echo > .memdump)\n" |
Makefile = Makefile + "\t@(echo > .memdump)\n" |
for test in tests: |
for test in tests: |
Makefile = Makefile + "\t@($(CHECKER) %s)\n" % (test) | Makefile = Makefile + "\t$(CHECKER) %s\n" % (test) |
Makefile = Makefile + '\t@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)\n' | Makefile = Makefile + '\t@grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0\n' |
Makefile = Makefile + "\n\n" | |
try: |
try: |
old = open("Makefile.am", "r").read() |
old = open("Makefile.am", "r").read() |
if old != Makefile: |
if old != Makefile: |
Line 264 install-data-local:
|
Line 280 install-data-local:
|
print "Updated Makefile.am" |
print "Updated Makefile.am" |
except: |
except: |
print "Failed to read or save Makefile.am" |
print "Failed to read or save Makefile.am" |
# | # # |
# Autogenerate the .cvsignore too ... | # # Autogenerate the .cvsignore too ... DEPRECATED |
# | # # |
ignore = """.memdump | # ignore = """.memdump |
Makefile.in | #Makefile.in |
Makefile | #Makefile |
""" | #""" |
for example in examples: | # for example in examples: |
ignore = ignore + "%s\n" % (example) | # ignore = ignore + "%s\n" % (example) |
try: | # try: |
old = open(".cvsignore", "r").read() | # old = open(".cvsignore", "r").read() |
if old != ignore: | # if old != ignore: |
n = open(".cvsignore", "w").write(ignore) | # n = open(".cvsignore", "w").write(ignore) |
print "Updated .cvsignore" | # print "Updated .cvsignore" |
except: | # except: |
print "Failed to read or save .cvsignore" | # print "Failed to read or save .cvsignore" |
| |
if __name__ == "__main__": |
if __name__ == "__main__": |
load_api() |
load_api() |
output = open("examples.xml", "w") |
output = open("examples.xml", "w") |