diff --git a/setup.py b/setup.py index fa9ab09dce..d5317cbe44 100755 --- a/setup.py +++ b/setup.py @@ -70,13 +70,15 @@ def run(self): ) cmd = ["make", "-C", build_dir] + cmd_clean = ["make", "-C", build_dir, "clean"] def compile(): print("*" * 80) print("Running:", " ".join(cmd), "\n") try: - rc = subprocess.call(cmd) + # if compile returns 0, clean will also be run + rc = subprocess.call(cmd) or subprocess.call(cmd_clean) except Exception as error: print(error) rc = 40 @@ -97,7 +99,6 @@ def compile(): " In particular, netCDF file processing is " "unaffected." ) - print("-" * 80) print("\n", "*" * 80) print()