blob: 228747a68ebbd48d1c7219943c5c3bc76252231e (
plain)
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
|
#!/bin/python
import os
ROOT = "/home/nolln/u"
SRC = "src"
BUILD = "obj"
TEST = "test"
IGNORED = ["include", "lib", "bin", ".git", "vendor", "obj", ".dep"]
if __name__ == "__main__":
if not os.path.exists(BUILD):
os.mkdir(BUILD)
if not os.path.exists(f"{BUILD}/sys"):
os.mkdir(f"{BUILD}/sys")
if not os.path.exists(f"{BUILD}/rt"):
os.mkdir(f"{BUILD}/rt")
if not os.path.exists(TEST):
os.mkdir(TEST)
for root, dirs, _ in os.walk(f"{ROOT}/{SRC}"):
dirs[:] = [d for d in dirs if d not in IGNORED]
for newroot in [BUILD, TEST]:
blddir = f"{ROOT}/{newroot}/{root[len(ROOT)+len(SRC)+2:]}"
if not os.path.exists(blddir):
os.mkdir(blddir)
|