diff --git a/tools/configure b/tools/configure index ae60efc625f..97d7e6adcb8 100755 --- a/tools/configure +++ b/tools/configure @@ -108,6 +108,19 @@ def parse_command_line(args): % compiler) opts['compiler'] = compiler opts['os'] = machobj.get_value('OS') + + if args.clean: + files = ["Macros.make", "Macros.cmake", "env_mach_specific.xml", ".env_mach_specific.sh", + ".env_mach_specific.csh", "Depends.%s"%compiler, "Depends.%s"%args.machine, + "Depends.%s.%s"%(args.machine,compiler)] + for file_ in files: + if os.path.isfile(file_): + logger.warn("Removing file %s"%file_) + os.remove(file_) + if argcnt == 2: + opts['clean_only'] = True + return opts + # Set MPI library. if args.mpilib is not None: mpilib = args.mpilib @@ -134,17 +147,6 @@ def parse_command_line(args): opts['debug'] = debug - if args.clean: - files = ["Macros.make", "Macros.cmake", "env_mach_specific.xml", ".env_mach_specific.sh", - ".env_mach_specific.csh", "Depends.%s"%compiler, "Depends.%s"%args.machine, - "Depends.%s.%s"%(args.machine,compiler)] - for file_ in files: - if os.path.isfile(file_): - logger.warn("Removing file %s"%file_) - os.remove(file_) - if argcnt == 2: - opts['clean_only'] = True - return opts def _main():