diff --git a/scripts/build.py b/scripts/build.py index 11b8b5d9..24e49583 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -77,10 +77,14 @@ def run_make(module, 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) -def build(order, target): +def build(modules, order, target): if target in ["clean", "distclean"]: for m in reversed(order): run_make(m, target) + modules.remove(m) + if not len(modules): + print "all modules cleaned" + return else: for m in order: run_make(m, target) @@ -111,7 +115,7 @@ order = [] calculate_order(order, modules, glob_prereq_type) order = [m for m in order if m not in exclude] print "order is: " + ' '.join(order) -build(order, target) +build(modules, order, target) print datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")