Update "clean".

This commit is contained in:
Christoffer Lerno
2023-10-05 19:06:55 +02:00
parent 32f6d711ac
commit d16ad0b4c7
3 changed files with 11 additions and 4 deletions

View File

@@ -597,17 +597,24 @@ void compile_target(BuildOptions *options)
compile();
}
void clean_obj_files(void)
{
file_delete_all_files_in_dir_with_suffix(active_target.ir_file_dir, ".ll");
file_delete_all_files_in_dir_with_suffix(active_target.asm_file_dir, ".s");
file_delete_all_files_in_dir_with_suffix(active_target.object_file_dir, ".obj");
file_delete_all_files_in_dir_with_suffix(active_target.object_file_dir, ".o");
}
void compile_clean(BuildOptions *options)
{
init_build_target(&active_target, options);
file_delete_all_files_in_dir_with_suffix(active_target.build_dir, get_object_extension());
clean_obj_files();
}
void compile_file_list(BuildOptions *options)
{
init_build_target(&active_target, options);
if (options->command == COMMAND_CLEAN_RUN)
{
file_delete_all_files_in_dir_with_suffix(active_target.build_dir, get_object_extension());
clean_obj_files();
}
compile();
}

View File

@@ -485,7 +485,7 @@ bool file_delete_all_files_in_dir_with_suffix(const char *path, const char *suff
{
assert(path);
#if (_MSC_VER)
const char *cmd = "del /q %s\\*%s";
const char *cmd = "del /q \"%s\\*%s\"";
#else
const char *cmd = "rm -f %s/*%s";
#endif

View File

@@ -1 +1 @@
#define COMPILER_VERSION "0.4.669"
#define COMPILER_VERSION "0.4.670"