Fix clean target in build.py: Unnecessarily always cleaned all modules

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2014-11-28 13:49:56 +00:00
commit 910e8468be

View file

@ -77,10 +77,14 @@ def run_make(module, target):
if subprocess.call(["make", target]): if subprocess.call(["make", target]):
raise Exception(time.strftime("%Y-%m-%d %H:%M") + ": failed to make target " + target + " in module " + module + " below base " + proj_base) raise Exception(time.strftime("%Y-%m-%d %H:%M") + ": failed to make target " + target + " in module " + module + " below base " + proj_base)
def build(order, target): def build(modules, order, target):
if target in ["clean", "distclean"]: if target in ["clean", "distclean"]:
for m in reversed(order): for m in reversed(order):
run_make(m, target) run_make(m, target)
modules.remove(m)
if not len(modules):
print "all modules cleaned"
return
else: else:
for m in order: for m in order:
run_make(m, target) run_make(m, target)
@ -111,7 +115,7 @@ order = []
calculate_order(order, modules, glob_prereq_type) calculate_order(order, modules, glob_prereq_type)
order = [m for m in order if m not in exclude] order = [m for m in order if m not in exclude]
print "order is: " + ' '.join(order) print "order is: " + ' '.join(order)
build(order, target) build(modules, order, target)
print datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") print datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")