MCPcopy Create free account
hub / github.com/ElementsProject/elements / parse_makefile

Function parse_makefile

build_msvc/msvc-autogen.py:33–51  ·  view source on GitHub ↗
(makefile)

Source from the content-addressed store, hash-verified

31
32
33def parse_makefile(makefile):
34 with open(makefile, 'r', encoding='utf-8') as file:
35 current_lib = ''
36 for line in file.read().splitlines():
37 if current_lib:
38 source = line.split()[0]
39 if source.endswith('.cpp') and not source.startswith('$') and source not in ignore_list:
40 source_filename = source.replace('/', '\\')
41 object_filename = source.replace('/', '_')[:-4] + ".obj"
42 lib_sources[current_lib].append((source_filename, object_filename))
43 if not line.endswith('\\'):
44 current_lib = ''
45 continue
46 for lib in libs:
47 _lib = lib.replace('-', '_')
48 if re.search(_lib + '.*_SOURCES \\= \\\\', line):
49 current_lib = lib
50 lib_sources[current_lib] = []
51 break
52
53def set_common_properties(toolset):
54 with open(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), 'r', encoding='utf-8') as rfile:

Callers 1

mainFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected