#endif
#ifndef _di_fake_build_copy_
- f_return_status fake_build_copy(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string label, const f_string_static source, const f_string_static destination, const f_string_statics files) {
- f_status status = F_none;
+ void fake_build_copy(const fake_data data, const f_mode mode, const f_string label, const f_string_static source, const f_string_static destination, const f_string_statics files, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
f_directory_statuss failures = f_directory_statuss_initialize;
f_string_dynamic path_source = f_string_dynamic_initialize;
f_string_dynamic destination_file = f_string_dynamic_initialize;
printf("%cCopying %s.%c", f_string_eol[0], label, f_string_eol[0]);
}
- f_macro_string_dynamic_new(status, path_source, source.used);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_macro_string_dynamic_new", F_true);
+ f_macro_string_dynamic_new(*status, path_source, source.used);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "f_macro_string_dynamic_new", F_true);
f_macro_string_dynamic_delete_simple(path_source);
- return status;
+ return;
}
memcpy(path_source.string, source.string, source.used);
path_source.used = source.used - 1;
}
- status = fl_string_dynamic_append_nulless(files.array[i], &path_source);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true);
+ *status = fl_string_dynamic_append_nulless(files.array[i], &path_source);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
- status = fl_string_dynamic_terminate(&path_source);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true);
+ *status = fl_string_dynamic_terminate(&path_source);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_terminate", F_true);
break;
}
- if ((status = f_directory_is(path_source.string)) == F_true) {
- status = fl_directory_copy_content(path_source.string, destination.string, path_source.used, destination.used, mode, f_file_default_read_size, F_false, (data.verbosity == fake_verbosity_verbose) ? f_type_output : 0, &failures);
+ if ((*status = f_directory_is(path_source.string)) == F_true) {
+ *status = fl_directory_copy_content(path_source.string, destination.string, path_source.used, destination.used, mode, f_file_default_read_size, F_false, (data.verbosity == fake_verbosity_verbose) ? f_type_output : 0, &failures);
- if (F_status_is_error(status)) {
+ if (F_status_is_error(*status)) {
if (data.verbosity == fake_verbosity_verbose) {
for (f_string_length j = 0; j < failures.used; j++) {
- fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, destination.string, F_true);
+ fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(*status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, destination.string, F_true);
} // for
- if (F_status_set_fine(status) != F_failure) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_directory_copy_content", F_true);
+ if (F_status_set_fine(*status) != F_failure) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_directory_copy_content", F_true);
}
break;
}
else if (data.verbosity != fake_verbosity_quiet) {
- fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, destination.string, F_true);
+ fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(*status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, destination.string, F_true);
}
break;
}
}
- else if (status == F_false) {
+ else if (*status == F_false) {
destination_file.used = 0;
- status = fl_string_dynamic_append_nulless(destination, &destination_file);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true);
+ *status = fl_string_dynamic_append_nulless(destination, &destination_file);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
- status = f_file_name_base(path_source.string, path_source.used, &destination_file);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_file_name_base", F_true);
+ *status = f_file_name_base(path_source.string, path_source.used, &destination_file);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "f_file_name_base", F_true);
break;
}
- status = f_file_copy(path_source.string, destination_file.string, mode, f_file_default_read_size, F_false);
+ *status = f_file_copy(path_source.string, destination_file.string, mode, f_file_default_read_size, F_false);
- if (F_status_is_error(status)) {
- fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(status), "f_file_copy", "copy", "to", path_source.string, destination_file.string, F_true);
+ if (F_status_is_error(*status)) {
+ fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(*status), "f_file_copy", "copy", "to", path_source.string, destination_file.string, F_true);
break;
}
printf("Copied file '%s' to '%s'.%c", path_source.string, destination_file.string, f_string_eol[0]);
}
}
- else if (F_status_is_error(status)) {
- fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_directory_is", path_source.string, "create", F_false, F_true);
+ else if (F_status_is_error(*status)) {
+ fake_print_error_file(data.context, data.verbosity, F_status_set_fine(*status), "f_directory_is", path_source.string, "create", F_false, F_true);
break;
}
- status = F_none;
+ *status = F_none;
} // for
f_macro_directory_statuss_delete_simple(failures);
f_macro_string_dynamic_delete_simple(path_source);
f_macro_string_dynamic_delete_simple(destination_file);
- return F_none;
+ if (F_status_is_fine(*status)) {
+ fake_build_touch(data, file_stage, status);
+ }
}
#endif // _di_fake_build_copy_
#ifndef _di_fake_build_skeleton_
- f_return_status fake_build_skeleton(const fake_data data, const fake_build_setting setting, const mode_t mode) {
- f_status status = F_none;
+ void fake_build_skeleton(const fake_data data, const fake_build_setting setting, const mode_t mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
const f_string_static *directorys[] = {
&data.path_build,
for (uint8_t i = 0; i < 15; i++) {
if (directorys[i]->used == 0) continue;
- status = f_directory_create(directorys[i]->string, mode);
+ *status = f_directory_create(directorys[i]->string, mode);
- if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_file_found) continue;
+ if (F_status_is_error(*status)) {
+ if (F_status_set_fine(*status) == F_file_found) continue;
- fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_directory_create", directorys[i]->string, "create", F_false, F_true);
- return status;
+ fake_print_error_file(data.context, data.verbosity, F_status_set_fine(*status), "f_directory_create", directorys[i]->string, "create", F_false, F_true);
+ return;
}
if (data.verbosity == fake_verbosity_verbose) {
}
} // for
- return F_none;
+ fake_build_touch(data, file_stage, status);
}
#endif // _di_fake_build_skeleton_
#ifndef _di_fake_build_execute_process_script_
- f_return_status fake_build_execute_process_script(const fake_data data, const fake_build_setting setting, const f_string_static process_script) {
- if (process_script.used == 0) return F_none;
+ void fake_build_execute_process_script(const fake_data data, const fake_build_setting setting, const f_string_static process_script, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+ if (process_script.used == 0) return;
- f_status status = F_none;
f_string_dynamics arguments = f_string_dynamics_initialize;
- status = fll_execute_arguments_add(fake_other_operation_build, fake_other_operation_build_length, &arguments);
+ *status = fll_execute_arguments_add(fake_other_operation_build, fake_other_operation_build_length, &arguments);
// ensure console color mode is passed to the scripts so that they can also react to color mode.
- if (!F_status_is_error(status) && data.context.mode != f_color_mode_none) {
+ if (!F_status_is_error(*status) && data.context.mode != f_color_mode_none) {
char argument[3] = { f_console_symbol_disable, 0, 0 };
if (data.context.mode == f_color_mode_dark) {
argument[1] = f_console_standard_short_no_color[0];
}
- status = fll_execute_arguments_add(argument, 2, &arguments);
+ *status = fll_execute_arguments_add(argument, 2, &arguments);
}
// ensure verbosity level is passed to the scripts so that they can also react to requested verbosity.
- if (!F_status_is_error(status) && data.verbosity != fake_verbosity_normal) {
+ if (!F_status_is_error(*status) && data.verbosity != fake_verbosity_normal) {
char argument[3] = { f_console_symbol_disable, 0, 0 };
if (data.verbosity == fake_verbosity_quiet) {
argument[1] = f_console_standard_short_debug[0];
}
- status = fll_execute_arguments_add(argument, 2, &arguments);
+ *status = fll_execute_arguments_add(argument, 2, &arguments);
}
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_execute_arguments_add", F_true);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_macro_string_dynamics_delete_simple(arguments);
- return status;
+ return;
}
{
data.path_work.used,
};
- status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_prefix_length, parameters_name, parameters_name_length, parameters_value, parameters_value_length, 7, &arguments);
+ *status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_prefix_length, parameters_name, parameters_name_length, parameters_value, parameters_value_length, 7, &arguments);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_execute_arguments_add_parameter_set", F_true);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true);
f_macro_string_dynamics_delete_simple(arguments);
- return status;
+ return;
}
}
function = "fl_string_dynamic_append_nulless";
if (process_script.string[0] != '/') {
- status = fl_string_dynamic_append_nulless(data.path_data_build, &path);
+ *status = fl_string_dynamic_append_nulless(data.path_data_build, &path);
}
- if (!F_status_is_error(status)) {
- status = fl_string_dynamic_append_nulless(process_script, &path);
+ if (!F_status_is_error(*status)) {
+ *status = fl_string_dynamic_append_nulless(process_script, &path);
}
- if (!F_status_is_error(status)) {
+ if (!F_status_is_error(*status)) {
function = "fl_string_dynamic_terminate";
- status = fl_string_dynamic_terminate(&path);
+ *status = fl_string_dynamic_terminate(&path);
}
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), function, F_true);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), function, F_true);
f_macro_string_dynamic_delete_simple(path);
f_macro_string_dynamics_delete_simple(arguments);
- return status;
+ return;
}
}
f_path_present_working_length
};
- f_macro_string_dynamics_new(status, names, 2);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true);
+ f_macro_string_dynamics_new(*status, names, 2);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "f_macro_string_dynamics_new", F_true);
f_macro_string_dynamic_delete_simple(path);
f_macro_string_dynamics_delete_simple(arguments);
f_macro_string_dynamics_delete_simple(names);
- return status;
+ return;
}
f_string_dynamic part = f_string_dynamic_initialize;
for (uint8_t i = 0; i < 2; i++) {
- status = fl_string_append(variables_name[i], variables_length[i], &part);
- if (F_status_is_error(status)) break;
+ *status = fl_string_append(variables_name[i], variables_length[i], &part);
+ if (F_status_is_error(*status)) break;
names.array[names.used].string = part.string;
names.array[names.used].used = part.used;
f_macro_string_dynamic_clear(part);
} // for
- if (!F_status_is_error(status)) {
+ if (!F_status_is_error(*status)) {
if (names.used + setting.environment.used > names.size) {
if (names.used + setting.environment.used > f_array_length_size) {
if (data.verbosity != fake_verbosity_quiet) {
f_macro_string_dynamic_delete_simple(part);
f_macro_string_dynamics_delete_simple(arguments);
f_macro_string_dynamics_delete_simple(names);
- return F_status_set_error(F_buffer_too_large);
+ *status = F_status_set_error(F_buffer_too_large);
+ return;
}
- f_macro_string_dynamics_resize(status, names, names.used + setting.environment.used);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_macro_string_dynamics_resize", F_true);
+ f_macro_string_dynamics_resize(*status, names, names.used + setting.environment.used);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "f_macro_string_dynamics_resize", F_true);
f_macro_string_dynamic_delete_simple(part);
f_macro_string_dynamics_delete_simple(arguments);
f_macro_string_dynamics_delete_simple(names);
- return status;
+ return;
}
}
for (f_string_length i = 0; i < setting.environment.used; i++) {
- status = fl_string_dynamic_append_nulless(setting.environment.array[i], &part);
- if (F_status_is_error(status)) break;
+ *status = fl_string_dynamic_append_nulless(setting.environment.array[i], &part);
+ if (F_status_is_error(*status)) break;
names.array[names.used].string = part.string;
names.array[names.used].used = part.used;
f_macro_string_dynamic_delete_simple(part);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_append", F_true);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_append", F_true);
f_macro_string_dynamic_delete_simple(path);
f_macro_string_dynamics_delete_simple(arguments);
f_macro_string_dynamics_delete_simple(names);
- return status;
+ return;
}
}
f_string_dynamic variable_value = f_string_dynamic_initialize;
for (f_string_length i = 0; i < names.used; i++) {
- status = f_environment_get_dynamic(names.array[i], &variable_value);
- if (F_status_is_error(status)) {
- status = F_status_set_fine(status);
-
- if (status == F_memory_reallocation) {
+ *status = f_environment_get_dynamic(names.array[i], &variable_value);
+ if (F_status_is_error(*status)) {
+ if (F_status_set_fine(*status) == F_memory_reallocation) {
function = "f_macro_string_dynamics_resize";
break;
}
}
if (environment_names.used + 1 > environment_names.size) {
- f_macro_string_dynamics_resize(status, environment_names, environment_names.size + f_memory_default_allocation_step);
+ f_macro_string_dynamics_resize(*status, environment_names, environment_names.size + f_memory_default_allocation_step);
- if (!F_status_is_error(status)) {
- f_macro_string_dynamics_resize(status, environment_values, environment_values.size + f_memory_default_allocation_step);
+ if (!F_status_is_error(*status)) {
+ f_macro_string_dynamics_resize(*status, environment_values, environment_values.size + f_memory_default_allocation_step);
}
- if (F_status_is_error(status)) {
+ if (F_status_is_error(*status)) {
function = "f_macro_string_dynamics_resize";
break;
}
}
- status = fl_string_dynamic_append(names.array[i], &variable_name);
+ *status = fl_string_dynamic_append(names.array[i], &variable_name);
- if (F_status_is_error(status)) {
+ if (F_status_is_error(*status)) {
function = "fl_string_append";
break;
}
f_macro_string_dynamics_delete_simple(names);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, status, function, F_true);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, *status, function, F_true);
f_macro_string_dynamic_delete_simple(variable_name);
f_macro_string_dynamic_delete_simple(variable_value);
f_macro_string_dynamics_delete_simple(environment_values);
f_macro_string_dynamic_delete_simple(path);
f_macro_string_dynamics_delete_simple(arguments);
- return status;
+ return;
}
int result = 0;
- status = fll_execute_path_environment(path.string, arguments, environment_names, environment_values, &result);
+ *status = fll_execute_path_environment(path.string, arguments, environment_names, environment_values, &result);
f_macro_string_dynamics_delete_simple(environment_names);
f_macro_string_dynamics_delete_simple(environment_values);
f_macro_string_dynamics_delete_simple(arguments);
}
- if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_failure) {
+ if (F_status_is_error(*status)) {
+ if (F_status_set_fine(*status) == F_failure) {
if (data.verbosity != fake_verbosity_quiet) {
fprintf(f_type_error, "%c", f_string_eol[0]);
fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to execute script: ");
}
}
else {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_execute_path_environment", F_true);
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fll_execute_path_environment", F_true);
}
}
+ else {
+ fake_build_touch(data, file_stage, status);
+ }
f_macro_string_dynamic_delete_simple(path);
-
- return status;
}
#endif // _di_fake_build_execute_process_script_
+#ifndef _di_fake_build_libraries_script_
+ void fake_build_libraries_script(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
+ // @todo needs to perform some sort of regex replace on the library scripts.
+
+ fake_build_touch(data, file_stage, status);
+ }
+#endif // _di_fake_build_libraries_script_
+
+#ifndef _di_fake_build_libraries_shared_
+ void fake_build_libraries_shared(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
+ // needs to strip the prefix and the filename extension '.c', '.cpp', etc.. to get the name." (call f_file_name_base() and then find last '.').
+
+ // $compiler $sources -shared -Wl,-soname,lib$name.so.$major -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $flags_all $arguments $flags_shared $flags_library
+ // ln -vsf lib$name.so.$major.$minor.$micro ${path_build}libraries/shared/lib$name.so.$major
+ // ln -vsf lib$name.so.$major ${path_build}libraries/shared/lib$name.so
+
+ fake_build_touch(data, file_stage, status);
+ }
+#endif // _di_fake_build_libraries_shared_
+
+#ifndef _di_fake_build_libraries_static_
+ void fake_build_libraries_static(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
+ // needs to strip the prefix and the filename extension '.c', '.cpp', etc.. to get the name." (call f_file_name_base() and then find last '.').
+
+ // $linker rcs ${path_build}libraries/static/lib$name.a $sources
+
+ fake_build_touch(data, file_stage, status);
+ }
+#endif // _di_fake_build_libraries_static_
+
+#ifndef _di_fake_build_objects_static_
+ void fake_build_objects_static(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
+ // needs to strip the prefix and the filename extension '.c', '.cpp', etc.. to get the name." (call f_file_name_base() and then find last '.').
+
+ // $compiler $path_c$i -c -static -o ${path_build}objects/$i.o $arguments_static $arguments_include $flags_all $arguments $flags_static $flags_library
+
+ fake_build_touch(data, file_stage, status);
+ }
+#endif // _di_fake_build_objects_static_
+
#ifndef _di_fake_build_operate_
f_return_status fake_build_operate(const fake_data data) {
if (data.verbosity != fake_verbosity_quiet) {
f_macro_mode_set_default_umask(mode, data.umask);
- status = fake_build_setting_load(data, &setting);
-
- if (F_status_is_fine(status)) {
- status = fake_build_stage_load(data, &stage);
- }
+ fake_build_setting_load(data, &setting, &status);
- if (F_status_is_fine(status) && f_file_exists(stage.file_skeleton.string) != F_true) {
- status = fake_build_skeleton(data, setting, mode.directory);
+ fake_build_stage_load(data, &stage, &status);
- fake_build_touch(data, stage.file_skeleton, mode, &status);
- }
+ fake_build_skeleton(data, setting, mode.directory, stage.file_skeleton, &status);
- if (F_status_is_fine(status) && f_file_exists(stage.file_process_pre.string) != F_true) {
- status = fake_build_execute_process_script(data, setting, setting.process_pre);
+ fake_build_execute_process_script(data, setting, setting.process_pre, stage.file_process_pre, &status);
- fake_build_touch(data, stage.file_process_pre, mode, &status);
- }
+ fake_build_copy(data, mode, "setting files", data.path_data_settings, data.path_build_settings, setting.build_sources_setting, stage.file_sources_settings, &status);
- if (F_status_is_fine(status) && f_file_exists(stage.file_sources_settings.string) != F_true) {
- status = fake_build_copy(data, setting, mode, "setting files", data.path_data_settings, data.path_build_settings, setting.build_sources_setting);
+ if (setting.build_language == fake_build_language_type_bash) {
+ fake_build_libraries_script(data, setting, mode, stage.file_libraries_script, &status);
- fake_build_touch(data, stage.file_sources_settings, mode, &status);
- }
+ fake_build_programs_script(data, setting, mode, stage.file_programs_script, &status);
- if (setting.build_language == fake_build_language_type_bash) {
- // @todo
+ if (setting.build_script) {
+ fake_build_copy(data, mode, "scripts", data.path_sources_script, data.path_build_programs_script, setting.build_sources_script, stage.file_sources_script, &status);
+ }
}
else {
const f_string_dynamic *path_sources = 0;
path_sources = &data.path_sources_cpp;
}
- if (F_status_is_fine(status) && f_file_exists(stage.file_sources_headers.string) != F_true) {
- status = fake_build_copy(data, setting, mode, "header files", *path_sources, data.path_build_includes, setting.build_sources_headers);
-
- fake_build_touch(data, stage.file_sources_headers, mode, &status);
- }
+ fake_build_copy(data, mode, "header files", *path_sources, data.path_build_includes, setting.build_sources_headers, stage.file_sources_headers, &status);
if (setting.build_shared) {
- if (F_status_is_fine(status) && f_file_exists(stage.file_libraries_shared.string) != F_true) {
- // @todo
- //status = fake_build_libraries_shared();
-
- fake_build_touch(data, stage.file_libraries_shared, mode, &status);
- }
-
- if (F_status_is_fine(status) && f_file_exists(stage.file_programs_shared.string) != F_true) {
- // @todo
- //status = fake_build_programs_shared();
+ fake_build_libraries_shared(data, setting, mode, stage.file_libraries_shared, &status);
- fake_build_touch(data, stage.file_programs_shared, mode, &status);
- }
+ fake_build_programs_shared(data, setting, mode, stage.file_programs_shared, &status);
}
if (setting.build_static) {
- if (F_status_is_fine(status) && f_file_exists(stage.file_objects_static.string) != F_true) {
- // @todo
- //status = fake_build_objects_static();
-
- fake_build_touch(data, stage.file_objects_static, mode, &status);
- }
+ fake_build_objects_static(data, setting, mode, stage.file_objects_static, &status);
- if (F_status_is_fine(status) && f_file_exists(stage.file_libraries_static.string) != F_true) {
- // @todo
- //status = fake_build_libraries_static();
+ fake_build_libraries_static(data, setting, mode, stage.file_libraries_static, &status);
- fake_build_touch(data, stage.file_libraries_static, mode, &status);
- }
-
- if (F_status_is_fine(status) && f_file_exists(stage.file_programs_static.string) != F_true) {
- // @todo
- //status = fake_build_programs_static();
+ fake_build_programs_static(data, setting, mode, stage.file_programs_static, &status);
+ }
- fake_build_touch(data, stage.file_programs_static, mode, &status);
- }
+ if (setting.build_script) {
+ fake_build_copy(data, mode, "scripts", data.path_sources_script, data.path_build_programs_script, setting.build_sources_script, stage.file_sources_script, &status);
}
}
- if (F_status_is_fine(status) && f_file_exists(stage.file_process_post.string) != F_true) {
- status = fake_build_execute_process_script(data, setting, setting.process_post);
-
- fake_build_touch(data, stage.file_process_post, mode, &status);
- }
+ fake_build_execute_process_script(data, setting, setting.process_post, stage.file_process_post, &status);
fake_macro_build_settings_delete_simple(setting);
fake_macro_build_stage_delete_simple(stage);
}
#endif // _di_fake_build_operate_
+#ifndef _di_fake_build_programs_script_
+ void fake_build_programs_script(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
+ // @todo needs to perform some sort of regex replace on the program scripts.
+
+ fake_build_touch(data, file_stage, status);
+ }
+#endif // _di_fake_build_programs_script_
+
+#ifndef _di_fake_build_programs_shared_
+ void fake_build_programs_shared(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
+ // needs to strip the prefix and the filename extension '.c', '.cpp', etc.. to get the name." (call f_file_name_base() and then find last '.').
+
+ // $compiler $sources -o ${path_build}programs/shared/$name $arguments_shared $arguments_include $flags_all $arguments $flags_shared $flags_program
+
+ fake_build_touch(data, file_stage, status);
+ }
+#endif // _di_fake_build_programs_shared_
+
+#ifndef _di_fake_build_programs_static_
+ void fake_build_programs_static(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) {
+ if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return;
+
+ // needs to strip the prefix and the filename extension '.c', '.cpp', etc.. to get the name." (call f_file_name_base() and then find last '.').
+
+ // $compiler -static -o ${path_build}programs/static/$name $sources $arguments_static $arguments_include $flags_all $arguments $flags_static $flags_program
+
+ fake_build_touch(data, file_stage, status);
+ }
+#endif // _di_fake_build_programs_static_
+
#ifndef _di_fake_build_setting_load_
- f_return_status fake_build_setting_load(const fake_data data, fake_build_setting *setting) {
- f_status status = F_none;
+ void fake_build_setting_load(const fake_data data, fake_build_setting *setting, f_status *status) {
+ if (F_status_is_error(*status)) return;
+
f_file file = f_file_initialize;
f_string_dynamic buffer = f_string_dynamic_initialize;
+ *status = F_none;
+
{
f_string name_function = f_string_initialize;
name_function = "f_file_exists";
- status = f_file_exists(data.file_data_build_settings.string);
+ *status = f_file_exists(data.file_data_build_settings.string);
- if (status == F_true) {
+ if (*status == F_true) {
name_function = "f_file_open";
- status = f_file_open(data.file_data_build_settings.string, 0, &file);
+ *status = f_file_open(data.file_data_build_settings.string, 0, &file);
- if (status == F_none) {
+ if (*status == F_none) {
name_function = "f_file_read";
- status = f_file_read(file, &buffer);
+ *status = f_file_read(file, &buffer);
f_file_close(&file.id);
}
}
- else if (status == F_false) {
- status = F_status_set_error(F_file_found_not);
+ else if (*status == F_false) {
+ *status = F_status_set_error(F_file_found_not);
}
- if (F_status_is_error(status)) {
- fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), name_function, data.file_data_build_settings.string, "create", F_true, F_true);
+ if (F_status_is_error(*status)) {
+ fake_print_error_file(data.context, data.verbosity, F_status_set_fine(*status), name_function, data.file_data_build_settings.string, "create", F_true, F_true);
f_macro_string_dynamic_delete_simple(buffer);
- return status;
+ return;
}
}
range.start = 0;
range.stop = buffer.used - 1;
- status = fll_fss_extended_read(&buffer, &range, &objects, &contents);
+ *status = fll_fss_extended_read(&buffer, &range, &objects, &contents);
- if (F_status_is_error(status)) {
+ if (F_status_is_error(*status)) {
f_macro_fss_objects_delete_simple(objects);
f_macro_fss_contents_delete_simple(contents);
f_macro_string_dynamic_delete_simple(buffer);
- if (status == F_status_set_error(F_incomplete_utf_stop)) {
+ if (*status == F_status_set_error(F_incomplete_utf_stop)) {
if (data.verbosity != fake_verbosity_quiet) {
fprintf(f_type_error, "%c", f_string_eol[0]);
fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
fl_color_print_line(f_type_error, data.context.error, data.context.reset, "').");
}
}
- else if (status == F_status_set_error(F_incomplete_utf_stop)) {
+ else if (*status == F_status_set_error(F_incomplete_utf_stop)) {
if (data.verbosity != fake_verbosity_quiet) {
fprintf(f_type_error, "%c", f_string_eol[0]);
fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
}
}
else {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_fss_extended_read", F_true);
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fll_fss_extended_read", F_true);
}
f_macro_fss_objects_delete_simple(objects);
f_macro_fss_contents_delete_simple(contents);
f_macro_string_dynamic_delete_simple(buffer);
- return status;
+ return;
}
{
fake_build_setting_name_build_language,
fake_build_setting_name_build_libraries,
fake_build_setting_name_build_linker,
+ fake_build_setting_name_build_script,
fake_build_setting_name_build_shared,
fake_build_setting_name_build_sources_headers,
fake_build_setting_name_build_sources_library,
fake_build_setting_name_build_sources_program,
fake_build_setting_name_build_sources_settings,
- fake_build_setting_name_build_sources_shell,
+ fake_build_setting_name_build_sources_script,
fake_build_setting_name_build_static,
fake_build_setting_name_defines_all,
fake_build_setting_name_defines_shared,
fake_build_setting_name_modes_default,
fake_build_setting_name_path_headers,
fake_build_setting_name_path_language,
+ fake_build_setting_name_path_library_script,
fake_build_setting_name_path_library_shared,
fake_build_setting_name_path_library_static,
+ fake_build_setting_name_path_program_script,
fake_build_setting_name_path_program_shared,
fake_build_setting_name_path_program_static,
fake_build_setting_name_process_post,
fake_build_setting_name_build_language_length,
fake_build_setting_name_build_libraries_length,
fake_build_setting_name_build_linker_length,
+ fake_build_setting_name_build_script_length,
fake_build_setting_name_build_shared_length,
fake_build_setting_name_build_sources_headers_length,
fake_build_setting_name_build_sources_library_length,
fake_build_setting_name_build_sources_program_length,
fake_build_setting_name_build_sources_settings_length,
- fake_build_setting_name_build_sources_shell_length,
+ fake_build_setting_name_build_sources_script_length,
fake_build_setting_name_build_static_length,
fake_build_setting_name_defines_all_length,
fake_build_setting_name_defines_shared_length,
fake_build_setting_name_modes_default_length,
fake_build_setting_name_path_headers_length,
fake_build_setting_name_path_language_length,
+ fake_build_setting_name_path_library_script_length,
fake_build_setting_name_path_library_shared_length,
fake_build_setting_name_path_library_static_length,
+ fake_build_setting_name_path_program_script_length,
fake_build_setting_name_path_program_shared_length,
fake_build_setting_name_path_program_static_length,
fake_build_setting_name_process_post_length,
};
f_string_dynamics build_language = f_string_dynamics_initialize;
+ f_string_dynamics build_script = f_string_dynamics_initialize;
f_string_dynamics build_shared = f_string_dynamics_initialize;
f_string_dynamics build_static = f_string_dynamics_initialize;
f_string_dynamics path_headers = f_string_dynamics_initialize;
f_string_dynamics path_language = f_string_dynamics_initialize;
+ f_string_dynamics path_library_script = f_string_dynamics_initialize;
f_string_dynamics path_library_shared = f_string_dynamics_initialize;
f_string_dynamics path_library_static = f_string_dynamics_initialize;
+ f_string_dynamics path_program_script = f_string_dynamics_initialize;
f_string_dynamics path_program_shared = f_string_dynamics_initialize;
f_string_dynamics path_program_static = f_string_dynamics_initialize;
f_string_dynamics process_post = f_string_dynamics_initialize;
&build_language,
&setting->build_libraries,
&setting->build_linker,
+ &build_script,
&build_shared,
&setting->build_sources_headers,
&setting->build_sources_library,
&setting->build_sources_program,
&setting->build_sources_setting,
- &setting->build_sources_shell,
+ &setting->build_sources_script,
&build_static,
&setting->defines_all,
&setting->defines_shared,
&setting->modes_default,
&path_headers,
&path_language,
+ &path_library_script,
&path_library_shared,
&path_library_static,
+ &path_program_script,
&path_program_shared,
&path_program_static,
&process_post,
f_string function = "fll_fss_snatch_apart";
- status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, settings_length, settings_value, fake_build_setting_total);
+ *status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, settings_length, settings_value, fake_build_setting_total);
- if (status == F_none) {
+ if (*status == F_none) {
f_string_dynamic settings_mode_name_dynamic[fake_build_setting_total];
f_string settings_mode_names[fake_build_setting_total];
f_string_length setting_mode_lengths[fake_build_setting_total];
}
error_printed = F_true;
- status = F_status_set_error(F_parameter);
+ *status = F_status_set_error(F_parameter);
break;
}
for (j = 0; j < fake_build_setting_total; j++) {
setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used;
- f_macro_string_dynamic_new(status, settings_mode_name_dynamic[j], setting_mode_lengths[j]);
- if (F_status_is_error(status)) {
+ f_macro_string_dynamic_new(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]);
+ if (F_status_is_error(*status)) {
function = "f_macro_string_dynamic_new";
break;
}
settings_mode_names[j] = settings_mode_name_dynamic[j].string;
} // for
- if (status == F_none) {
- status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, setting_mode_lengths, settings_value, fake_build_setting_total);
+ if (*status == F_none) {
+ *status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, setting_mode_lengths, settings_value, fake_build_setting_total);
- if (F_status_is_error(status)) {
+ if (F_status_is_error(*status)) {
function = "fll_fss_snatch_apart";
}
}
f_macro_string_dynamic_delete_simple(settings_mode_name_dynamic[j]);
} // for
- if (F_status_is_error(status)) break;
+ if (F_status_is_error(*status)) break;
} // for
}
- if (F_status_is_error(status)) {
- if (status == F_status_set_error(F_string_too_large)) {
+ if (F_status_is_error(*status)) {
+ if (*status == F_status_set_error(F_string_too_large)) {
if (data.verbosity != fake_verbosity_quiet) {
// @todo update FSS functions to return which setting index the problem happened on.
fprintf(f_type_error, "%c", f_string_eol[0]);
}
}
else if (!error_printed) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), function, F_true);
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), function, F_true);
}
}
else {
const f_string settings_single_name[] = {
fake_build_setting_name_build_language,
+ fake_build_setting_name_build_script,
fake_build_setting_name_build_shared,
fake_build_setting_name_build_static,
fake_build_setting_name_path_headers,
fake_build_setting_name_path_language,
+ fake_build_setting_name_path_library_script,
fake_build_setting_name_path_library_shared,
fake_build_setting_name_path_library_static,
+ fake_build_setting_name_path_program_script,
fake_build_setting_name_path_program_shared,
fake_build_setting_name_path_program_static,
fake_build_setting_name_process_post,
const f_string_statics *settings_single_source[] = {
&build_language,
+ &build_script,
&build_shared,
&build_static,
&path_headers,
&path_language,
+ &path_library_script,
&path_library_shared,
&path_library_static,
+ &path_program_script,
&path_program_shared,
&path_program_static,
&process_post,
bool *settings_single_bool[] = {
0,
+ &setting->build_script,
&setting->build_shared,
&setting->build_static,
};
0,
0,
0,
+ 0,
&setting->path_headers,
&setting->path_language,
+ &setting->path_library_script,
&setting->path_library_shared,
&setting->path_library_static,
+ &setting->path_program_script,
&setting->path_program_shared,
&setting->path_program_static,
&setting->process_post,
4,
1,
1,
+ 1,
+ 2,
+ 2,
2,
2,
2,
3,
};
- for (f_array_length i = 0; i < 16; i++) {
+ for (f_array_length i = 0; i < 18; i++) {
if (settings_single_source[i]->used == 0) continue;
if (settings_single_source[i]->used > 1) {
}
}
else {
- status = fl_string_dynamic_append_nulless(settings_single_source[i]->array[0], settings_single_destination[i]);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true);
+ *status = fl_string_dynamic_append_nulless(settings_single_source[i]->array[0], settings_single_destination[i]);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
if (settings_single_type[i] == 2) {
- status = fl_string_append_assure(f_path_separator, f_path_separator_length, settings_single_destination[i]);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true);
+ *status = fl_string_append_assure(f_path_separator, f_path_separator_length, settings_single_destination[i]);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
}
- status = fl_string_dynamic_terminate(settings_single_destination[i]);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true);
+ *status = fl_string_dynamic_terminate(settings_single_destination[i]);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_terminate", F_true);
break;
}
}
}
f_macro_string_dynamics_delete_simple(build_language);
+ f_macro_string_dynamics_delete_simple(build_script);
f_macro_string_dynamics_delete_simple(build_shared);
f_macro_string_dynamics_delete_simple(build_static);
f_macro_string_dynamics_delete_simple(path_headers);
f_macro_string_dynamics_delete_simple(path_language);
+ f_macro_string_dynamics_delete_simple(path_library_script);
f_macro_string_dynamics_delete_simple(path_library_shared);
f_macro_string_dynamics_delete_simple(path_library_static);
+ f_macro_string_dynamics_delete_simple(path_program_script);
f_macro_string_dynamics_delete_simple(path_program_shared);
f_macro_string_dynamics_delete_simple(path_program_static);
f_macro_string_dynamics_delete_simple(process_post);
}
f_macro_string_dynamic_delete_simple(buffer);
-
- return status;
}
#endif // _di_fake_build_setting_load_
#ifndef _di_fake_build_stage_load_
- f_return_status fake_build_stage_load(const fake_data data, fake_build_stage *stage) {
- f_status status = F_none;
+ void fake_build_stage_load(const fake_data data, fake_build_stage *stage, f_status *status) {
+ if (F_status_is_error(*status)) return;
const f_string names[] = {
+ fake_build_stage_libraries_script,
fake_build_stage_libraries_shared,
fake_build_stage_libraries_static,
fake_build_stage_objects_static,
fake_build_stage_process_post,
fake_build_stage_process_pre,
+ fake_build_stage_programs_script,
fake_build_stage_programs_shared,
fake_build_stage_programs_static,
fake_build_stage_skeleton,
fake_build_stage_sources_headers,
+ fake_build_stage_sources_script,
fake_build_stage_sources_settings,
};
const f_string_length lengths[] = {
+ fake_build_stage_libraries_script_length,
fake_build_stage_libraries_shared_length,
fake_build_stage_libraries_static_length,
fake_build_stage_objects_static_length,
fake_build_stage_process_post_length,
fake_build_stage_process_pre_length,
+ fake_build_stage_programs_script_length,
fake_build_stage_programs_shared_length,
fake_build_stage_programs_static_length,
fake_build_stage_skeleton_length,
fake_build_stage_sources_headers_length,
+ fake_build_stage_sources_script_length,
fake_build_stage_sources_settings_length,
};
f_string_dynamic *values[] = {
+ &stage->file_libraries_script,
&stage->file_libraries_shared,
&stage->file_libraries_static,
&stage->file_objects_static,
&stage->file_process_post,
&stage->file_process_pre,
+ &stage->file_programs_script,
&stage->file_programs_shared,
&stage->file_programs_static,
&stage->file_skeleton,
&stage->file_sources_headers,
+ &stage->file_sources_script,
&stage->file_sources_settings,
};
+ *status = F_none;
+
for (uint8_t i = 0; i < fake_build_stage_total; i++) {
- status = fl_string_dynamic_append_nulless(data.path_build_stage, values[i]);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true);
+ *status = fl_string_dynamic_append_nulless(data.path_build_stage, values[i]);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
- status = fl_string_append_nulless(names[i], lengths[i], values[i]);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true);
+ *status = fl_string_append_nulless(names[i], lengths[i], values[i]);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
- status = fl_string_dynamic_terminate(values[i]);
- if (F_status_is_error(status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true);
+ *status = fl_string_dynamic_terminate(values[i]);
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "fl_string_dynamic_terminate", F_true);
break;
}
} // for
-
- return status;
}
#endif // _di_fake_build_stage_load_
#ifndef _di_fake_build_touch_
- void fake_build_touch(const fake_data data, const f_string_dynamic file, const f_mode mode, f_status *status) {
- if (F_status_is_fine(*status)) {
- *status = f_file_touch(file.string, mode.regular, F_false);
+ void fake_build_touch(const fake_data data, const f_string_dynamic file, f_status *status) {
+ if (F_status_is_error(*status)) return;
- if (F_status_is_error(*status)) {
- fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "f_file_touch", F_true);
- }
+ f_mode mode = f_mode_initialize;
+
+ f_macro_mode_set_default_umask(mode, data.umask);
+
+ *status = f_file_touch(file.string, mode.regular, F_false);
+
+ if (F_status_is_error(*status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(*status), "f_file_touch", F_true);
}
}
#endif // _di_fake_build_touch_
typedef struct {
uint8_t build_language;
+ bool build_script;
bool build_shared;
bool build_static;
f_string_dynamic path_language;
f_string_dynamic path_headers;
+ f_string_dynamic path_library_script;
f_string_dynamic path_library_shared;
f_string_dynamic path_library_static;
+ f_string_dynamic path_program_script;
f_string_dynamic path_program_shared;
f_string_dynamic path_program_static;
f_string_dynamic process_post;
f_string_dynamics build_sources_library;
f_string_dynamics build_sources_program;
f_string_dynamics build_sources_setting;
- f_string_dynamics build_sources_shell;
+ f_string_dynamics build_sources_script;
f_string_dynamics defines_all;
f_string_dynamics defines_shared;
f_string_dynamics defines_static;
0, \
F_true, \
F_true, \
+ F_true, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
f_string_dynamic_initialize, \
f_string_dynamic_initialize, \
f_string_dynamic_initialize, \
f_string_dynamics_initialize, \
}
- #define fake_macro_build_settings_delete_simple(settings) \
- f_macro_string_dynamic_delete_simple(settings.path_headers) \
- f_macro_string_dynamic_delete_simple(settings.path_language) \
- f_macro_string_dynamic_delete_simple(settings.path_library_shared) \
- f_macro_string_dynamic_delete_simple(settings.path_library_static) \
- f_macro_string_dynamic_delete_simple(settings.path_program_shared) \
- f_macro_string_dynamic_delete_simple(settings.path_program_static) \
- f_macro_string_dynamic_delete_simple(settings.process_post) \
- f_macro_string_dynamic_delete_simple(settings.process_pre) \
- f_macro_string_dynamic_delete_simple(settings.project_level) \
- f_macro_string_dynamic_delete_simple(settings.project_name) \
- f_macro_string_dynamic_delete_simple(settings.version_major) \
- f_macro_string_dynamic_delete_simple(settings.version_micro) \
- f_macro_string_dynamic_delete_simple(settings.version_minor) \
- f_macro_string_dynamics_delete_simple(settings.build_compiler) \
- f_macro_string_dynamics_delete_simple(settings.build_libraries) \
- f_macro_string_dynamics_delete_simple(settings.build_linker) \
- f_macro_string_dynamics_delete_simple(settings.build_sources_headers) \
- f_macro_string_dynamics_delete_simple(settings.build_sources_library) \
- f_macro_string_dynamics_delete_simple(settings.build_sources_program) \
- f_macro_string_dynamics_delete_simple(settings.build_sources_setting) \
- f_macro_string_dynamics_delete_simple(settings.build_sources_shell) \
- f_macro_string_dynamics_delete_simple(settings.defines_all) \
- f_macro_string_dynamics_delete_simple(settings.defines_shared) \
- f_macro_string_dynamics_delete_simple(settings.defines_static) \
- f_macro_string_dynamics_delete_simple(settings.environment) \
- f_macro_string_dynamics_delete_simple(settings.flags_all) \
- f_macro_string_dynamics_delete_simple(settings.flags_library) \
- f_macro_string_dynamics_delete_simple(settings.flags_program) \
- f_macro_string_dynamics_delete_simple(settings.flags_shared) \
- f_macro_string_dynamics_delete_simple(settings.flags_static) \
- f_macro_string_dynamics_delete_simple(settings.modes) \
- f_macro_string_dynamics_delete_simple(settings.modes_default)
+ #define fake_macro_build_settings_delete_simple(setting) \
+ f_macro_string_dynamic_delete_simple(setting.path_headers) \
+ f_macro_string_dynamic_delete_simple(setting.path_language) \
+ f_macro_string_dynamic_delete_simple(setting.path_library_script) \
+ f_macro_string_dynamic_delete_simple(setting.path_library_shared) \
+ f_macro_string_dynamic_delete_simple(setting.path_library_static) \
+ f_macro_string_dynamic_delete_simple(setting.path_program_script) \
+ f_macro_string_dynamic_delete_simple(setting.path_program_shared) \
+ f_macro_string_dynamic_delete_simple(setting.path_program_static) \
+ f_macro_string_dynamic_delete_simple(setting.process_post) \
+ f_macro_string_dynamic_delete_simple(setting.process_pre) \
+ f_macro_string_dynamic_delete_simple(setting.project_level) \
+ f_macro_string_dynamic_delete_simple(setting.project_name) \
+ f_macro_string_dynamic_delete_simple(setting.version_major) \
+ f_macro_string_dynamic_delete_simple(setting.version_micro) \
+ f_macro_string_dynamic_delete_simple(setting.version_minor) \
+ f_macro_string_dynamics_delete_simple(setting.build_compiler) \
+ f_macro_string_dynamics_delete_simple(setting.build_libraries) \
+ f_macro_string_dynamics_delete_simple(setting.build_linker) \
+ f_macro_string_dynamics_delete_simple(setting.build_sources_headers) \
+ f_macro_string_dynamics_delete_simple(setting.build_sources_library) \
+ f_macro_string_dynamics_delete_simple(setting.build_sources_program) \
+ f_macro_string_dynamics_delete_simple(setting.build_sources_setting) \
+ f_macro_string_dynamics_delete_simple(setting.build_sources_script) \
+ f_macro_string_dynamics_delete_simple(setting.defines_all) \
+ f_macro_string_dynamics_delete_simple(setting.defines_shared) \
+ f_macro_string_dynamics_delete_simple(setting.defines_static) \
+ f_macro_string_dynamics_delete_simple(setting.environment) \
+ f_macro_string_dynamics_delete_simple(setting.flags_all) \
+ f_macro_string_dynamics_delete_simple(setting.flags_library) \
+ f_macro_string_dynamics_delete_simple(setting.flags_program) \
+ f_macro_string_dynamics_delete_simple(setting.flags_shared) \
+ f_macro_string_dynamics_delete_simple(setting.flags_static) \
+ f_macro_string_dynamics_delete_simple(setting.modes) \
+ f_macro_string_dynamics_delete_simple(setting.modes_default)
#define fake_build_setting_name_build_compiler "build_compiler"
#define fake_build_setting_name_build_language "build_language"
#define fake_build_setting_name_build_libraries "build_libraries"
#define fake_build_setting_name_build_linker "build_linker"
+ #define fake_build_setting_name_build_script "build_script"
#define fake_build_setting_name_build_shared "build_shared"
#define fake_build_setting_name_build_sources_headers "build_sources_headers"
#define fake_build_setting_name_build_sources_library "build_sources_library"
#define fake_build_setting_name_build_sources_program "build_sources_program"
#define fake_build_setting_name_build_sources_settings "build_sources_setting"
- #define fake_build_setting_name_build_sources_shell "build_sources_shell"
+ #define fake_build_setting_name_build_sources_script "build_sources_script"
#define fake_build_setting_name_build_static "build_static"
#define fake_build_setting_name_defines_all "defines_all"
#define fake_build_setting_name_defines_shared "defines_shared"
#define fake_build_setting_name_modes_default "modes_default"
#define fake_build_setting_name_path_language "path_language"
#define fake_build_setting_name_path_headers "path_headers"
+ #define fake_build_setting_name_path_library_script "path_library_script"
#define fake_build_setting_name_path_library_shared "path_library_shared"
#define fake_build_setting_name_path_library_static "path_library_static"
+ #define fake_build_setting_name_path_program_script "path_program_script"
#define fake_build_setting_name_path_program_shared "path_program_shared"
#define fake_build_setting_name_path_program_static "path_program_static"
#define fake_build_setting_name_process_post "process_post"
#define fake_build_setting_name_build_language_length 14
#define fake_build_setting_name_build_libraries_length 15
#define fake_build_setting_name_build_linker_length 12
+ #define fake_build_setting_name_build_script_length 12
#define fake_build_setting_name_build_shared_length 12
#define fake_build_setting_name_build_sources_headers_length 21
#define fake_build_setting_name_build_sources_library_length 21
#define fake_build_setting_name_build_sources_program_length 21
#define fake_build_setting_name_build_sources_settings_length 22
- #define fake_build_setting_name_build_sources_shell_length 19
+ #define fake_build_setting_name_build_sources_script_length 20
#define fake_build_setting_name_build_static_length 12
#define fake_build_setting_name_environment_length 11
#define fake_build_setting_name_defines_all_length 11
#define fake_build_setting_name_modes_default_length 13
#define fake_build_setting_name_path_language_length 13
#define fake_build_setting_name_path_headers_length 12
+ #define fake_build_setting_name_path_library_script_length 19
#define fake_build_setting_name_path_library_shared_length 19
#define fake_build_setting_name_path_library_static_length 19
+ #define fake_build_setting_name_path_program_script_length 19
#define fake_build_setting_name_path_program_shared_length 19
#define fake_build_setting_name_path_program_static_length 19
#define fake_build_setting_name_process_post_length 12
#define fake_build_setting_name_version_micro_length 13
#define fake_build_setting_name_version_minor_length 13
- #define fake_build_setting_total 35
+ #define fake_build_setting_total 38
#define fake_build_setting_bool_yes "yes"
#define fake_build_setting_bool_no "no"
#ifndef _di_fake_build_stage_
typedef struct {
+ f_string_dynamic file_libraries_script;
f_string_dynamic file_libraries_shared;
f_string_dynamic file_libraries_static;
f_string_dynamic file_objects_static;
f_string_dynamic file_process_post;
f_string_dynamic file_process_pre;
+ f_string_dynamic file_programs_script;
f_string_dynamic file_programs_shared;
f_string_dynamic file_programs_static;
f_string_dynamic file_skeleton;
f_string_dynamic file_sources_headers;
+ f_string_dynamic file_sources_script;
f_string_dynamic file_sources_settings;
} fake_build_stage;
f_string_dynamic_initialize, \
f_string_dynamic_initialize, \
f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
}
- #define fake_build_stage_total 10
+ #define fake_build_stage_total 13
#define fake_macro_build_stage_delete_simple(stage) \
+ f_macro_string_dynamic_delete_simple(stage.file_libraries_script) \
f_macro_string_dynamic_delete_simple(stage.file_libraries_shared) \
f_macro_string_dynamic_delete_simple(stage.file_libraries_static) \
f_macro_string_dynamic_delete_simple(stage.file_objects_static) \
f_macro_string_dynamic_delete_simple(stage.file_process_post) \
f_macro_string_dynamic_delete_simple(stage.file_process_pre) \
+ f_macro_string_dynamic_delete_simple(stage.file_programs_script) \
f_macro_string_dynamic_delete_simple(stage.file_programs_shared) \
f_macro_string_dynamic_delete_simple(stage.file_programs_static) \
f_macro_string_dynamic_delete_simple(stage.file_skeleton) \
f_macro_string_dynamic_delete_simple(stage.file_sources_headers) \
+ f_macro_string_dynamic_delete_simple(stage.file_sources_script) \
f_macro_string_dynamic_delete_simple(stage.file_sources_settings)
+ #define fake_build_stage_libraries_script "libraries_script.built"
#define fake_build_stage_libraries_shared "libraries_shared.built"
#define fake_build_stage_libraries_static "libraries_static.built"
#define fake_build_stage_objects_static "objects_static.built"
#define fake_build_stage_process_post "process_post.built"
#define fake_build_stage_process_pre "process_pre.built"
+ #define fake_build_stage_programs_script "programs_script.built"
#define fake_build_stage_programs_shared "programs_shared.built"
#define fake_build_stage_programs_static "programs_static.built"
#define fake_build_stage_skeleton "skeleton.built"
#define fake_build_stage_sources_headers "sources_headers.built"
+ #define fake_build_stage_sources_script "sources_script.built"
#define fake_build_stage_sources_settings "sources_settings.built"
+ #define fake_build_stage_libraries_script_length 22
#define fake_build_stage_libraries_shared_length 22
#define fake_build_stage_libraries_static_length 22
#define fake_build_stage_objects_static_length 20
#define fake_build_stage_process_post_length 18
#define fake_build_stage_process_pre_length 17
+ #define fake_build_stage_programs_script_length 21
#define fake_build_stage_programs_shared_length 21
#define fake_build_stage_programs_static_length 21
#define fake_build_stage_skeleton_length 14
#define fake_build_stage_sources_headers_length 21
+ #define fake_build_stage_sources_script_length 20
#define fake_build_stage_sources_settings_length 22
#endif // _di_fake_build_stage_
/**
- * Copy over the data settings files.
+ * Copy over the data setting files.
*
* @param data
* The program data.
- * @param settings
- * All build related settings data from the build settings file.
* @param mode
* The modes for each file type.
* @param label
* The specific build path to copy to.
* @param files
* The files to copy from source to destination.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_copy_
- extern f_return_status fake_build_copy(const fake_data data, const fake_build_setting settings, const f_mode mode, const f_string label, const f_string_static source, const f_string_static destination, const f_string_statics files) f_gcc_attribute_visibility_internal;
+ extern void fake_build_copy(const fake_data data, const f_mode mode, const f_string label, const f_string_static source, const f_string_static destination, const f_string_statics files, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
#endif // _di_fake_build_copy_
/**
*
* @param data
* The program data.
- * @param settings
- * All build related settings data from the build settings file.
+ * @param setting
+ * All build related setting data from the build setting file.
* @param mode
* The directory mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_skeleton_
- extern f_return_status fake_build_skeleton(const fake_data data, const fake_build_setting settings, const mode_t mode) f_gcc_attribute_visibility_internal;
+ extern void fake_build_skeleton(const fake_data data, const fake_build_setting setting, const mode_t mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
#endif // _di_fake_build_skeleton_
/**
*
* @param data
* The program data.
- * @param settings
- * All build related settings data from the build settings file.
+ * @param setting
+ * All build related setting data from the build setting file.
* @param process_script
* The setting_data file name fo the appropriate process script.
- * This is expected to be either settings.process_pre or settings.process_post.
+ * This is expected to be either setting.process_pre or setting.process_post.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_execute_process_script_
- extern f_return_status fake_build_execute_process_script(const fake_data data, const fake_build_setting settings, const f_string_static process_script) f_gcc_attribute_visibility_internal;
+ extern void fake_build_execute_process_script(const fake_data data, const fake_build_setting setting, const f_string_static process_script, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
#endif // _di_fake_build_execute_process_script_
/**
+ * Build the script libraries.
+ *
+ * @param data
+ * The program data.
+ * @param setting
+ * All build related setting data from the build setting file.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_libraries_script_
+ extern void fake_build_libraries_script(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_libraries_script_
+
+/**
+ * Build the shared libraries.
+ *
+ * @param data
+ * The program data.
+ * @param setting
+ * All build related setting data from the build setting file.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_libraries_shared_
+ extern void fake_build_libraries_shared(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_libraries_shared_
+
+/**
+ * Build the static libraries.
+ *
+ * @param data
+ * The program data.
+ * @param setting
+ * All build related setting data from the build setting file.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_libraries_static_
+ extern void fake_build_libraries_static(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_libraries_static_
+
+/**
+ * Build the static objects.
+ *
+ * @param data
+ * The program data.
+ * @param setting
+ * All build related setting data from the build setting file.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_objects_static_
+ extern void fake_build_objects_static(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_objects_static_
+
+/**
* Execute the build operation.
*
* @param data
#endif // _di_fake_build_operate_
/**
- * Find the build settings file, load it, validate it, and process it.
+ * Build the script programs.
+ *
+ * @param data
+ * The program data.
+ * @param setting
+ * All build related setting data from the build setting file.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_programs_script_
+ extern void fake_build_programs_script(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_programs_script_
+
+/**
+ * Build the shared programs.
+ *
+ * @param data
+ * The program data.
+ * @param setting
+ * All build related setting data from the build setting file.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_programs_shared_
+ extern void fake_build_programs_shared(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_programs_shared_
+
+/**
+ * Build the static programs.
*
* @param data
* The program data.
- * @param settings
- * All build related settings data from the build settings file are loaded into this.
- * These settings will have any specified mode property applied.
+ * @param setting
+ * All build related setting data from the build setting file.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ * @param status
+ * The return status.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_programs_static_
+ extern void fake_build_programs_static(const fake_data data, const fake_build_setting setting, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_programs_static_
+
+/**
+ * Find the build setting file, load it, validate it, and process it.
+ *
+ * @param data
+ * The program data.
+ * @param setting
+ * All build related setting data from the build setting file are loaded into this.
+ * These setting will have any specified mode property applied.
+ * @param status
+ * The return status.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_setting_load_
- extern f_return_status fake_build_setting_load(const fake_data data, fake_build_setting *settings) f_gcc_attribute_visibility_internal;
+ extern void fake_build_setting_load(const fake_data data, fake_build_setting *setting, f_status *status) f_gcc_attribute_visibility_internal;
#endif // _di_fake_build_setting_load_
/**
* The program data.
* @param stage
* All stage file paths.
+ * @param status
+ * The return status.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_stage_load_
- extern f_return_status fake_build_stage_load(const fake_data data, fake_build_stage *stage) f_gcc_attribute_visibility_internal;
+ extern void fake_build_stage_load(const fake_data data, fake_build_stage *stage, f_status *status) f_gcc_attribute_visibility_internal;
#endif // _di_fake_build_stage_load_
/**
* The program data.
* @param file
* The file path to touch.
- * @param mode
- * The file mode to use.
* @param status
* The return status.
- * This gets updated if f_file_touch() is executed.
*
* @see f_file_touch()
*/
#ifndef _di_fake_build_touch_
- extern void fake_build_touch(const fake_data data, const f_string_dynamic file, const f_mode mode, f_status *status) f_gcc_attribute_visibility_internal;
+ extern void fake_build_touch(const fake_data data, const f_string_dynamic file, f_status *status) f_gcc_attribute_visibility_internal;
#endif // _di_fake_build_touch_
#ifdef __cplusplus