4 SUFFIXS
= (".c", ".h", ".cc", ".hh", ".cpp", ".hpp", ".cxx", ".hxx")
5 ROOT
= os
.path
.abspath(sys
.argv
[0])
6 ROOT
= os
.path
.dirname(ROOT
)
7 ROOT
= os
.path
.dirname(ROOT
)
10 def main(index
=0, SUFFIXS
=SUFFIXS
):
12 for dirpath
, dirnames
, filenames
in os
.walk("include"):
13 for filename
in filenames
:
14 source
= os
.path
.join(dirpath
, filename
)
15 prefix
, suffix
= os
.path
.splitext(source
)
17 sources
.append(source
.replace("\\", "/"))
18 for dirpath
, dirnames
, filenames
in os
.walk("src"):
19 for filename
in filenames
:
20 source
= os
.path
.join(dirpath
, filename
)
21 prefix
, suffix
= os
.path
.splitext(source
)
23 sources
.append(source
.replace("\\", "/"))
24 sources
= sorted(sources
)
26 with
open("meson.build", "r") as f
:
28 cur
= re
.findall(r
"sources = ([^\]]+)", meson
)[index
] + "]\n"
29 new
= "[\n '" + "',\n '".join(sources
) + "',\n]\n"
30 with
open("meson.build", "wb") as f
:
31 meson
= f
.write(meson
.replace(cur
, new
).encode())
34 os
.chdir(ROOT
+ "/java")
37 os
.chdir(ROOT
+ "/lua")
39 os
.chdir(ROOT
+ "/quickjs")