1# Copyright 2021 Nikita Melekhin. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import os
6import glob
7import sys
8# sys.argv[2] Target to generate for
9
10platforms = ['x86', 'aarch32']
11
12ignore_platforms = []
13
14for platform in platforms:
15 if sys.argv[2] != platform:
16 ignore_platforms.append(platform)
17
18
19def is_file_type(name, ending):
20 if len(name) <= len(ending):
21 return False
22 return (name[-len(ending)-1::] == '.'+ending)
23
24
25def is_file_blocked(name):
26 global ignore_platforms
27 for platform in ignore_platforms:
28 if (name.find(platform) != -1):
29 return True
30 return False
31
32
33for path, subdirs, files in os.walk("../kernel/kernel"):
34 for name in files:
35 # It runs from out dir, at least it should
36 file = "//" + path[3:] + "/" + name
37 if not is_file_type(file, 'c') and not is_file_type(file, 's') and not is_file_type(file, 'S'):
38 continue
39 if is_file_blocked(file):
40 continue
41 print(file)
42
43
44def special_paths(platform):
45 pass
46
47
48special_paths(sys.argv[2])