File: depend.py

package info (click to toggle)
gerris 20131206%2Bdfsg-21
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 14,252 kB
  • sloc: ansic: 66,595; sh: 15,922; f90: 1,513; makefile: 1,150; fortran: 696; python: 493; awk: 104; lisp: 89; xml: 27
file content (44 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python3

import sys
import os
import os.path
import gfs2tex

print("## File generated automatically by depend.py: do not modify by hand")
print("")

dists = ""
depends = ""
docs = ""
tests = ""
for start in sys.argv[1:]:
    tests += "\\\n\t" + start + ".sh"
    f = open(start + ".sh", "w")
    f.write("python3 -u test.py " + start + "\n")
    f.close()
    os.chmod(start + ".sh",0o755)
    for root, dirs, files in os.walk(start,topdown=True):
        if not ".xvpics" in root:
            example = gfs2tex.Example(root)
            name = example.path + "/" + example.name + ".gfs"
            docs += "\\\n\t" + name + ".html"
            dists += "\\\n\t" + name
            depends += "\\\n\t" + name
            for f in example.required:
                if f != "S60-scaled.gts":
                    dists += "\\\n\t" + example.path + "/" + f
            for f in example.generated:
                depends += "\\\n\t" + example.path + "/" + f
                if f[-4:] == ".mpg" or f[-4:] == ".ogv" or f[-4:] == ".png" or f[-4:] == ".mp4":
                    docs += "\\\n\t" + example.path + "/" + f

print("DOCS = " + docs + dists)
print("")
print("TESTS = " + tests)
print("")
print("EXTRA_DIST += $(TESTS)" + dists)
print("")
print("TESTS = " + tests)
print("")
print("examples.tex: " + depends)