change LIBS_DEPS to MAIN_LIBS_DEPS

This commit is contained in:
Ladislas 2014-11-09 19:04:15 +01:00
parent 8305fa662f
commit 98d1d16ea0

View file

@ -14,8 +14,8 @@ includeRegex = re.compile("(?<=^\#include\s\")(.*)(?=\.h\")", re.DOTALL|re.M)
MAIN_SRCS = [] MAIN_SRCS = []
MAIN_LIBS = [] MAIN_LIBS = []
LIBS_DEPS = [] MAIN_LIBS_DEPS = []
LIBS_DEPS_STACK = [] MAIN_LIBS_DEPS_STACK = []
# Define functions # Define functions
@ -47,7 +47,7 @@ for src in MAIN_SRCS:
MAIN_LIBS = sorted(set(MAIN_LIBS)) MAIN_LIBS = sorted(set(MAIN_LIBS))
# Find LIBS_DEPS includes in MAIN_LIBS # Find MAIN_LIBS_DEPS includes in MAIN_LIBS
for lib in MAIN_LIBS: for lib in MAIN_LIBS:
if lib in USER_LIBS: if lib in USER_LIBS:
currentFile = open(os.path.join(USER_LIB_PATH, lib, lib + ".h")) currentFile = open(os.path.join(USER_LIB_PATH, lib, lib + ".h"))
@ -57,13 +57,13 @@ for lib in MAIN_LIBS:
if match is not None: if match is not None:
group = match.group(1) group = match.group(1)
if group in USER_LIBS and group not in MAIN_LIBS: if group in USER_LIBS and group not in MAIN_LIBS:
LIBS_DEPS_STACK.append(group) MAIN_LIBS_DEPS_STACK.append(group)
LIBS_DEPS_STACK = list(set(LIBS_DEPS_STACK)) MAIN_LIBS_DEPS_STACK = list(set(MAIN_LIBS_DEPS_STACK))
# Recursively find all dependencies of every libraries in USER_LIB_PATH # Recursively find all dependencies of every libraries in USER_LIB_PATH
while len(LIBS_DEPS_STACK) > 0: while len(MAIN_LIBS_DEPS_STACK) > 0:
for lib in LIBS_DEPS_STACK: for lib in MAIN_LIBS_DEPS_STACK:
if lib in USER_LIBS: if lib in USER_LIBS:
currentFile = open(os.path.join(USER_LIB_PATH, lib, lib + ".h")) currentFile = open(os.path.join(USER_LIB_PATH, lib, lib + ".h"))
@ -71,20 +71,20 @@ while len(LIBS_DEPS_STACK) > 0:
match = includeRegex.search(line) match = includeRegex.search(line)
if match is not None: if match is not None:
group = match.group(1) group = match.group(1)
if group in USER_LIBS and group not in LIBS_DEPS_STACK and group not in LIBS_DEPS and group not in MAIN_LIBS: if group in USER_LIBS and group not in MAIN_LIBS_DEPS_STACK and group not in MAIN_LIBS_DEPS and group not in MAIN_LIBS:
LIBS_DEPS_STACK.append(group) MAIN_LIBS_DEPS_STACK.append(group)
else: else:
if lib not in LIBS_DEPS: if lib not in MAIN_LIBS_DEPS:
LIBS_DEPS.append(lib) MAIN_LIBS_DEPS.append(lib)
if lib in LIBS_DEPS_STACK: if lib in MAIN_LIBS_DEPS_STACK:
LIBS_DEPS_STACK.remove(lib) MAIN_LIBS_DEPS_STACK.remove(lib)
LIBS_DEPS.sort() MAIN_LIBS_DEPS.sort()
# Output libraries for the Makefile # Output libraries for the Makefile
print("MAIN_LIBS"), print("MAIN_LIBS"),
outputLibs(MAIN_LIBS) outputLibs(MAIN_LIBS)
print("LIBS_DEPS"), print("MAIN_LIBS_DEPS"),
outputLibs(LIBS_DEPS) outputLibs(MAIN_LIBS_DEPS)