]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/iterator/doc/scanrst.py
1 # Copyright David Abrahams 2004. Use, modification and distribution is
2 # subject to the Boost Software License, Version 1.0. (See accompanying
3 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 # This script accepts a list of .rst files to be processed and
6 # generates Makefile dependencies for .html and .rst files to stdout.
10 include
= re
.compile(r
' *\.\. +(include|image):: +(.*)', re
.MULTILINE
)
12 def deps(path
, found
):
13 dir = os
.path
.split(path
)[0]
14 for m
in re
.findall(include
, open(path
).read()):
16 dependency
= os
.path
.normpath(os
.path
.join(dir,m
[1]))
17 if dependency
not in found
:
21 deps(dependency
, found
)
25 for file in sys
.argv
[1:]:
26 found
= deps(file, {})
28 base
= os
.path
.splitext(os
.path
.basename(file))[0]
29 print '%s.tex %s.html: %s' % (base
, base
, ' '.join(found
.keys()))