Skip to content

clean command

Remove compiled objects, module files, and built targets from a previous build.

bash
FoBiS.py clean [options]

Compiler options

OptionDescription
-only_objClean only compiled objects (.o), leave built targets
-only_targetClean only built targets (executables / libraries), leave objects
-compiler {gnu,intel,…,custom}Compiler (used to locate object paths, default: gnu)
-fc FCCompiler executable (for -compiler custom)
-cflags CFLAGSCompilation flags (used to locate output paths)
-lflags LFLAGSLinking flags
-modsw MODSWModule path switch (for -compiler custom)
-mpiMPI variant
-openmpOpenMP
-openmp_offloadOpenMP offload
-coarrayCoarrays
-coverageCoverage instrumentation
-profileProfiling instrumentation
-mklib {static,shared}Target was a library
-ch, --cflags_heritageAlso remove the cflags heritage file
-tb, --track_buildAlso remove the track-build info file

Directory options

OptionDefaultDescription
-s, --src./Root source directory
-dbld, --build_dir./Build output directory to clean
-dobj, --obj_dir./obj/Compiled objects directory
-dmod, --mod_dir./mod/Module interface files directory
-dlib, --lib_dirLibrary search directories
-i, --includeInclude file search directories
-ed, --exclude_dirsDirectories that were excluded from the build
-drs, --disable_recursive_searchFalseDo not recurse into subdirectories

File options

OptionDefaultDescription
-t, --targetAll programs foundSpecific target to clean
-o, --outputBasename of targetOutput executable name
-e, --excludeSource files that were excluded
-libsExternal libraries (full paths)
-vlibsVolatile external libraries (full paths)
-ext_libsExternal libraries (by name)
-ext_vlibsVolatile external libraries (by name)
-dependonInterdependent fobos files
-inc.inc .INC .h .HInclude file extensions
-extensions(all Fortran extensions)Parsed file extensions
-build_allFalseAll parsed sources were built

fobos options

OptionDescription
-f, --fobosSpecify a fobos file with a different name or path
-fci, --fobos_case_insensitiveCase-insensitive fobos option parsing
-modeSelect a fobos mode
-lmodesList available modes and exit
--print_fobos_templatePrint a fobos template with all current option values

Fancy options

OptionDescription
-colorsColoured terminal output
-l, --logWrite a log file
-q, --quietLess verbose output
-verboseMaximum verbosity

Examples

bash
# Clean everything (objects + targets)
FoBiS.py clean

# Clean only compiled objects, keep the executable
FoBiS.py clean -only_obj

# Clean only the built executable, keep objects
FoBiS.py clean -only_target

# Clean using settings from a fobos mode
FoBiS.py clean -f project.fobos -mode release

# Clean a specific build directory
FoBiS.py clean -dbld ./build/ -dobj ./build/obj/ -dmod ./build/mod/

fobos integration

When using a fobos file, clean reads the same directory and target settings as build, so the correct artefacts are removed without repeating paths on the command line.