f_string_lengths list_stack = f_string_lengths_initialize;
fake_make_data data_make = fake_make_data_initialize;
+ f_macro_string_dynamics_new(status, data_make.path.stack, f_memory_default_allocation_step);
+ 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);
+ return status;
+ }
+
+ status = f_path_current(F_true, &data_make.path.stack.array[0]);
+ if (F_status_is_error(status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_path_current", F_true);
+
+ fake_macro_make_data_delete_simple(data_make);
+ return status;
+ }
+
+ status = f_directory_open(data_make.path.stack.array[0].string, F_false, &data_make.path.top);
+ if (F_status_is_error(status)) {
+ fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_directory_open", F_true);
+
+ fake_macro_make_data_delete_simple(data_make);
+ return status;
+ }
+
f_macro_mode_set_default_umask(mode, data.umask);
data_make.fail = fake_make_operation_fail_type_exit;
fake_make_operate_section(data, data_make.main, &data_make, &list_stack, &status);
+ if (data_make.path.current > 0) {
+ f_file_close(&data_make.path.current);
+ }
+
+ {
+ f_status status_path = f_path_change_at(data_make.path.top);
+ if (F_status_is_error(status_path) && data.verbosity == fake_verbosity_verbose) {
+ fprintf(f_type_warning, "%c", f_string_eol[0]);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: Failed change back to orignal path '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", data_make.path.stack.array[0].string);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', status code = ");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%llu", F_status_set_fine(status_path));
+ fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, ".");
+ }
+ }
+
+ f_file_close(&data_make.path.top);
+
f_macro_string_lengths_delete_simple(list_stack);
fake_macro_make_data_delete_simple(data_make);
f_macro_string_dynamics_delete_simple(parameter.work)
#endif // _di_fake_make_parameter_
+#ifndef _di_fake_make_path_
+ typedef struct {
+ int top;
+ int current;
+
+ f_string_dynamics stack;
+ } fake_make_path;
+
+ #define fake_make_path_initialize { \
+ 0, \
+ 0, \
+ f_string_dynamics_initialize, \
+ }
+
+ #define fake_macro_make_path_delete_simple(path) \
+ f_macro_string_dynamics_delete_simple(path.stack)
+#endif // _di_fake_make_path_
+
#ifndef _di_fake_make_data_
typedef struct {
fake_build_setting setting_build;
fake_make_setting setting_make;
fake_environment environment;
+
fake_make_parameter parameter;
+ fake_make_path path;
f_fss_nameds fakefile;
f_string_dynamic buffer;
fake_make_setting_initialize, \
fake_environment_initialize, \
fake_make_parameter_initialize, \
+ fake_make_path_initialize, \
f_fss_nameds_initialize, \
f_string_dynamic_initialize, \
0, \
fake_macro_make_setting_delete_simple(data.setting_make) \
fake_macro_environment_delete_simple(data.environment) \
fake_macro_make_parameter_delete_simple(data.parameter) \
+ fake_macro_make_path_delete_simple(data.path) \
f_macro_fss_nameds_delete_simple(data.fakefile) \
f_macro_string_dynamic_delete_simple(data.buffer)
#endif // _di_fake_make_data_