fl_color_print(f_standard_output, context.notable, context.reset, "%s", fake_long_mode);
printf(" of 'fll_monolithic' is specified, build libaries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level').");
- printf("%c", f_string_eol);
+ printf("%c%c", f_string_eol, f_string_eol);
return f_none;
}
else if (operations[0]) {
status = fake_process_console_parameters(arguments, data);
+ if (!f_status_is_error(status)) {
+ status = fake_path_generate(data);
+ }
+
if (f_status_is_error(status)) {
fake_delete_data(data);
return f_status_set_error(status);
f_macro_string_dynamic_delete_simple(data->settings);
f_macro_string_dynamic_delete_simple(data->path_build);
+ f_macro_string_dynamic_delete_simple(data->path_build_documents);
+ f_macro_string_dynamic_delete_simple(data->path_build_includes);
+ f_macro_string_dynamic_delete_simple(data->path_build_libraries);
+ f_macro_string_dynamic_delete_simple(data->path_build_libraries_script);
+ f_macro_string_dynamic_delete_simple(data->path_build_libraries_shared);
+ f_macro_string_dynamic_delete_simple(data->path_build_libraries_static);
+ f_macro_string_dynamic_delete_simple(data->path_build_objects);
+ f_macro_string_dynamic_delete_simple(data->path_build_process);
+ f_macro_string_dynamic_delete_simple(data->path_build_programs);
+ f_macro_string_dynamic_delete_simple(data->path_build_programs_script);
+ f_macro_string_dynamic_delete_simple(data->path_build_programs_shared);
+ f_macro_string_dynamic_delete_simple(data->path_build_programs_static);
+ f_macro_string_dynamic_delete_simple(data->path_build_settings);
f_macro_string_dynamic_delete_simple(data->path_work);
f_macro_string_dynamic_delete_simple(data->path_source_build);
#define fake_default_allocation_step 4
#endif // _di_fake_default_allocation_step_
+/**
+ * Fake paths are hard-coded paths that are generally generated into a full path based on runtime settings.
+ *
+ * For example path_build_documents will become "build/documents/" if the fake_default_path_build is used.
+ */
+#ifndef _di_fake_path_
+ #define fake_path_directory_separator "/" // @todo this should be provided by a f_path library.
+
+ #define fake_path_build_documents "documents" fake_path_directory_separator
+ #define fake_path_build_includes "includes" fake_path_directory_separator
+ #define fake_path_build_libraries "libraries" fake_path_directory_separator
+ #define fake_path_build_libraries_script "script" fake_path_directory_separator
+ #define fake_path_build_libraries_shared "shared" fake_path_directory_separator
+ #define fake_path_build_libraries_static "static" fake_path_directory_separator
+ #define fake_path_build_objects "objects" fake_path_directory_separator
+ #define fake_path_build_process "process" fake_path_directory_separator
+ #define fake_path_build_programs "programs" fake_path_directory_separator
+ #define fake_path_build_programs_script "script" fake_path_directory_separator
+ #define fake_path_build_programs_shared "shared" fake_path_directory_separator
+ #define fake_path_build_programs_static "static" fake_path_directory_separator
+ #define fake_path_build_settings "settings" fake_path_directory_separator
+
+ #define fake_path_build_documents_length 10
+ #define fake_path_build_includes_length 9
+ #define fake_path_build_libraries_length 10
+ #define fake_path_build_libraries_script_length 6
+ #define fake_path_build_libraries_shared_length 6
+ #define fake_path_build_libraries_static_length 6
+ #define fake_path_build_objects_length 7
+ #define fake_path_build_process_length 7
+ #define fake_path_build_programs_length 9
+ #define fake_path_build_programs_script_length 7
+ #define fake_path_build_programs_shared_length 7
+ #define fake_path_build_programs_static_length 7
+ #define fake_path_build_settings_length 9
+#endif // _di_fake_path_
+
#ifndef _di_fake_defaults_
- #define fake_default_path_build "build/"
- #define fake_default_path_build_documents "build/documents/"
- #define fake_default_path_build_includes "build/includes/"
- #define fake_default_path_build_libaries "build/libaries/"
- #define fake_default_path_build_libaries_script "build/libaries/script/"
- #define fake_default_path_build_libaries_shared "build/libaries/shared/"
- #define fake_default_path_build_libaries_static "build/libaries/static/"
- #define fake_default_path_build_objects "build/objects/"
- #define fake_default_path_build_process "build/process/"
- #define fake_default_path_build_programs "build/programs/"
- #define fake_default_path_build_programs_script "build/programs/script/"
- #define fake_default_path_build_programs_shared "build/programs/shared/"
- #define fake_default_path_build_programs_static "build/programs/static/"
- #define fake_default_path_build_settings "build/settings/"
- #define fake_default_path_work ""
-
- #define fake_default_path_build_length 6
- #define fake_default_path_build_documents_length 16
- #define fake_default_path_build_includes_length 15
- #define fake_default_path_build_libaries_length 15
- #define fake_default_path_build_libaries_script_length 22
- #define fake_default_path_build_libaries_shared_length 22
- #define fake_default_path_build_libaries_static_length 22
- #define fake_default_path_build_objects_length 14
- #define fake_default_path_build_process_length 14
- #define fake_default_path_build_programs_length 15
- #define fake_default_path_build_programs_script_length 22
- #define fake_default_path_build_programs_shared_length 22
- #define fake_default_path_build_programs_static_length 22
- #define fake_default_path_build_settings_length 15
- #define fake_default_path_work_length 0
+ #define fake_default_path_build "build" fake_path_directory_separator
+ #define fake_default_path_work ""
+
+ #define fake_default_path_build_length 6
+ #define fake_default_path_work_length 0
#define fake_default_defines ""
#define fake_default_mode ""
#define fake_default_process_length 0
#define fake_default_settings_length 8
- #define fake_default_path_source_build "data/build/"
- #define fake_default_path_source_codes "sources/"
- #define fake_default_path_source_common "data/common/"
- #define fake_default_path_source_data "data/"
- #define fake_default_path_source_documents "data/documents/"
- #define fake_default_path_source_licenses "licenses/"
- #define fake_default_path_source_settings "data/build/"
+ #define fake_default_path_source_build "data" fake_path_directory_separator "build" fake_path_directory_separator
+ #define fake_default_path_source_codes "sources" fake_path_directory_separator
+ #define fake_default_path_source_common "data" fake_path_directory_separator "common" fake_path_directory_separator
+ #define fake_default_path_source_data "data" fake_path_directory_separator
+ #define fake_default_path_source_documents "data" fake_path_directory_separator "documents" fake_path_directory_separator
+ #define fake_default_path_source_licenses "licenses" fake_path_directory_separator
+ #define fake_default_path_source_settings "data" fake_path_directory_separator "build" fake_path_directory_separator
#define fake_default_path_source_build_length 11
#define fake_default_path_source_codes_length 8
#define fake_default_path_source_licenses_length 9
#define fake_default_path_source_settings_length 11
- #define fake_default_language_c "c/"
- #define fake_default_language_cpp "c++/"
- #define fake_default_language_shell "shell/"
+ #define fake_default_language_c "c" fake_path_directory_separator
+ #define fake_default_language_cpp "c++" fake_path_directory_separator
+ #define fake_default_language_shell "shell" fake_path_directory_separator
#define fake_default_language_c_length 2
#define fake_default_language_cpp_length 4
#define fake_short_process_length 1
#define fake_short_settings_length 1
+ #define fake_file_extension_built ".built"
+ #define fake_file_extension_building ".building"
+
+ #define fake_file_extension_built_length 6
+ #define fake_file_extension_building_length 9
+
#define fake_short_path_build "b"
#define fake_short_path_work "w"
f_string_dynamic settings;
f_string_dynamic path_build;
+ f_string_dynamic path_build_documents;
+ f_string_dynamic path_build_includes;
+ f_string_dynamic path_build_libraries;
+ f_string_dynamic path_build_libraries_script;
+ f_string_dynamic path_build_libraries_shared;
+ f_string_dynamic path_build_libraries_static;
+ f_string_dynamic path_build_objects;
+ f_string_dynamic path_build_process;
+ f_string_dynamic path_build_programs;
+ f_string_dynamic path_build_programs_script;
+ f_string_dynamic path_build_programs_shared;
+ f_string_dynamic path_build_programs_static;
+ f_string_dynamic path_build_settings;
f_string_dynamic path_work;
f_string_dynamic path_source_build;
f_string_dynamic_initialize, \
f_string_dynamic_initialize, \
f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
+ f_string_dynamic_initialize, \
fl_color_context_initialize, \
}
#endif // _di_fake_data_
#endif // _di_fake_build_operate_
#ifndef _di_fake_build_execute_process_script_
- f_return_status fake_build_execute_process_script(const fake_data data, const fake_build_settings settings, const f_string_dynamic process_script) {
+ f_return_status fake_build_execute_process_script(const fake_data data, const fake_build_settings settings, const f_string_static process_script) {
if (process_script.used == 0) return f_none;
f_status status = f_none;
+ //fake_file_extension_built
+
+ //if (fake_build_file_exists
+
const f_string parameter_prefixs[] = {
f_console_symbol_short_enable,
f_console_symbol_short_enable,
* 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_settings settings, const f_string_dynamic process_script) f_gcc_attribute_visibility_internal;
+ extern f_return_status fake_build_execute_process_script(const fake_data data, const fake_build_settings settings, const f_string_static process_script) f_gcc_attribute_visibility_internal;
#endif // _di_fake_build_execute_process_script_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fake_path_generate_
+ f_return_status fake_path_generate(fake_data *data) {
+ f_status status = f_none;
+ f_string function = "fl_string_dynamic_append";
+ uint8_t i = 0;
+
+ {
+ const f_string parameter_strings[] = {
+ fake_path_build_documents,
+ fake_path_build_includes,
+ fake_path_build_libraries,
+ fake_path_build_objects,
+ fake_path_build_process,
+ fake_path_build_programs,
+ fake_path_build_settings,
+ };
+
+ const f_string_length parameter_strings_lengths[] = {
+ fake_path_build_documents_length,
+ fake_path_build_includes_length,
+ fake_path_build_libraries_length,
+ fake_path_build_objects_length,
+ fake_path_build_process_length,
+ fake_path_build_programs_length,
+ fake_path_build_settings_length,
+ };
+
+ f_string_dynamic *parameter_values[] = {
+ &data->path_build_documents,
+ &data->path_build_includes,
+ &data->path_build_libraries,
+ &data->path_build_objects,
+ &data->path_build_process,
+ &data->path_build_programs,
+ &data->path_build_settings,
+ };
+
+ const uint8_t total = 7;
+
+ for (i = 0; i < total; i++) {
+ status = fl_string_dynamic_append_nulless(data->path_build, parameter_values[i]);
+ if (f_status_is_error(status)) break;
+
+ status = fl_string_append(parameter_strings[i], parameter_strings_lengths[i], parameter_values[i]);
+ if (f_status_is_error(status)) break;
+
+ status = fl_string_append_assure("/", 1, parameter_values[i]);
+ if (f_status_is_error(status)) {
+ function = "fl_string_append_assure";
+ break;
+ }
+
+ status = fl_string_dynamic_terminate(parameter_values[i]);
+ if (f_status_is_error(status)) {
+ function = "fl_string_dynamic_terminate";
+ break;
+ }
+ } // for
+ }
+
+ if (!f_status_is_error(status)) {
+ const f_string parameter_strings[] = {
+ fake_path_build_libraries_script,
+ fake_path_build_libraries_shared,
+ fake_path_build_libraries_static,
+ };
+
+ const f_string_length parameter_strings_lengths[] = {
+ fake_path_build_libraries_script_length,
+ fake_path_build_libraries_shared_length,
+ fake_path_build_libraries_static_length,
+ };
+
+ f_string_dynamic *parameter_values[] = {
+ &data->path_build_libraries_script,
+ &data->path_build_libraries_shared,
+ &data->path_build_libraries_static,
+ };
+
+ const uint8_t total = 3;
+
+ for (i = 0; i < total; i++) {
+ status = fl_string_dynamic_append_nulless(data->path_build_libraries, parameter_values[i]);
+ if (f_status_is_error(status)) break;
+
+ status = fl_string_append(parameter_strings[i], parameter_strings_lengths[i], parameter_values[i]);
+ if (f_status_is_error(status)) break;
+
+ status = fl_string_append_assure("/", 1, parameter_values[i]);
+ if (f_status_is_error(status)) {
+ function = "fl_string_append_assure";
+ break;
+ }
+
+ status = fl_string_dynamic_terminate(parameter_values[i]);
+ if (f_status_is_error(status)) {
+ function = "fl_string_dynamic_terminate";
+ break;
+ }
+ } // for
+ }
+
+ {
+ const f_string parameter_strings[] = {
+ fake_path_build_programs_script,
+ fake_path_build_programs_shared,
+ fake_path_build_programs_static,
+ };
+
+ const f_string_length parameter_strings_lengths[] = {
+ fake_path_build_programs_script_length,
+ fake_path_build_programs_shared_length,
+ fake_path_build_programs_static_length,
+ };
+
+ f_string_dynamic *parameter_values[] = {
+ &data->path_build_programs_script,
+ &data->path_build_programs_shared,
+ &data->path_build_programs_static,
+ };
+
+ const uint8_t total = 3;
+
+ for (i = 0; i < total; i++) {
+ status = fl_string_dynamic_append_nulless(data->path_build_programs, parameter_values[i]);
+ if (f_status_is_error(status)) break;
+
+ status = fl_string_append(parameter_strings[i], parameter_strings_lengths[i], parameter_values[i]);
+ if (f_status_is_error(status)) break;
+
+ status = fl_string_append_assure("/", 1, parameter_values[i]);
+ if (f_status_is_error(status)) {
+ function = "fl_string_append_assure";
+ break;
+ }
+
+ status = fl_string_dynamic_terminate(parameter_values[i]);
+ if (f_status_is_error(status)) {
+ function = "fl_string_dynamic_terminate";
+ break;
+ }
+ } // for
+ }
+
+ if (f_status_is_error(status)) {
+ fake_print_error(data->context, data->verbosity, f_status_set_fine(status), function, f_true);
+ return status;
+ }
+
+ return f_none;
+ }
+#endif // _di_fake_path_generate_
+
#ifndef _di_fake_print_error_
f_return_status fake_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) {
#endif
/**
+ * Generate all appropriate paths based on runtime information.
+ *
+ * @param data
+ * The program data.
+ *
+ * @return
+ * f_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_path_generate_
+ extern f_return_status fake_path_generate(fake_data *data) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_path_generate_
+
+/**
* Print generic error messages.
*
* @param context
# The purpose of this script is to provide an example for the post-process part of Fake.
# Despite being an example, it is intended to be actually used when using fake to build the fake project.
#
+# The dependencies of this script are: bash and sed.
+#
process_post_main(){
local grab_next=
local do_color=normal
local c_subtle="\\033[1;30m"
local c_prefix="\\"
- # the three supported parameters.
+ # the supported parameters.
local operation=
- local mode=
local defines=
+ local modes=
+ local process=
+ local file_settings=
+ local path_build=
+ local path_source_build=
+ local path_source_codes=
+ local path_source_common=
+ local path_source_data=
+ local path_source_documents=
+ local path_source_licenses=
+ local path_source_settings=
+ local path_work=
local verbosity=
+ # standard settings paths.
+ local path_directory_separator="/"
+ local path_build_documents=
+ local path_build_includes=
+ local path_build_libraries=
+ local path_build_libraries_script=
+ local path_build_libraries_shared=
+ local path_build_libraries_static=
+ local path_build_objects=
+ local path_build_process=
+ local path_build_programs=
+ local path_build_programs_script=
+ local path_build_programs_shared=
+ local path_build_programs_static=
+ local path_build_settings=
+
# grab all supported parameters, ignoring duplicates.
if [[ $# -gt 0 ]] ; then
t=$#
if [[ $operation == "" ]] ; then
operation=$p
fi
- elif [[ $p == "-m" ]] ; then
- grab_next="mode"
elif [[ $p == "-d" ]] ; then
grab_next="defines"
+ elif [[ $p == "-m" ]] ; then
+ grab_next="modes"
+ elif [[ $p == "-o" ]] ; then
+ grab_next="process"
+ elif [[ $p == "-s" ]] ; then
+ grab_next="file_settings"
+ elif [[ $p == "-b" ]] ; then
+ grab_next="path_build"
+ elif [[ $p == "-B" ]] ; then
+ grab_next="path_source_build"
+ elif [[ $p == "-C" ]] ; then
+ grab_next="path_source_codes"
+ elif [[ $p == "-O" ]] ; then
+ grab_next="path_source_common"
+ elif [[ $p == "-D" ]] ; then
+ grab_next="path_source_data"
+ elif [[ $p == "-M" ]] ; then
+ grab_next="path_source_documents"
+ elif [[ $p == "-L" ]] ; then
+ grab_next="path_source_licenses"
+ elif [[ $p == "-S" ]] ; then
+ grab_next="path_source_settings"
+ elif [[ $p == "-w" ]] ; then
+ grab_next="path_work"
+ elif [[ $p == "+D" ]] ; then
+ verbosity=debug
elif [[ $p == "+q" ]] ; then
verbosity=quiet
elif [[ $p == "+V" ]] ; then
verbosity=verbose
- elif [[ $p == "+D" ]] ; then
- verbosity=debug
- elif [[ $p == "+n" ]] ; then
- if [[ $do_color == "normal" ]] ; then
- do_color=none
- fi
elif [[ $p == "+l" ]] ; then
if [[ $do_color == "normal" ]] ; then
do_color=light
fi
+ elif [[ $p == "+n" ]] ; then
+ if [[ $do_color == "normal" ]] ; then
+ do_color=none
+ fi
fi
else
- if [[ $grab_next == "mode" ]] ; then
- if [[ $mode == "" ]] ; then
- mode=$p
- else
- mode="$mode $p"
- fi
- elif [[ $grab_next == "defines" ]] ; then
+ if [[ $grab_next == "defines" ]] ; then
if [[ $defines == "" ]] ; then
defines=$p
+ else
+ defines="$defines $p"
+ fi
+ elif [[ $grab_next == "modes" ]] ; then
+ if [[ $modes == "" ]] ; then
+ modes=$p
+ else
+ modes="$modes $p"
fi
+ elif [[ $grab_next == "process" ]] ; then
+ process=$p
+ elif [[ $grab_next == "file_settings" ]] ; then
+ file_settings=$p
+ elif [[ $grab_next == "path_build" ]] ; then
+ path_build=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_source_build" ]] ; then
+ path_source_build=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_source_codes" ]] ; then
+ path_source_codes=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_source_common" ]] ; then
+ path_source_common=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_source_data" ]] ; then
+ path_source_data=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_source_documents" ]] ; then
+ path_source_documents=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_source_licenses" ]] ; then
+ path_source_licenses=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_source_settings" ]] ; then
+ path_source_settings=$(process_post_path_fix $p)
+ elif [[ $grab_next == "path_work" ]] ; then
+ path_work=$(process_post_path_fix $p)
fi
grab_next=
c_prefix=
fi
+ # update paths based on parameters.
+ path_build_documents=${path_build}documents$path_directory_separator
+ path_build_includes=${path_build}includes$path_directory_separator
+ path_build_libraries=${path_build}libraries$path_directory_separator
+ path_build_libraries_script=${path_build_libraries}script$path_directory_separator
+ path_build_libraries_shared=${path_build_libraries}shared$path_directory_separator
+ path_build_libraries_static=${path_build_libraries}static$path_directory_separator
+ path_build_objects=${path_build}objects$path_directory_separator
+ path_build_process=${path_build}process$path_directory_separator
+ path_build_programs=${path_build}programs$path_directory_separator
+ path_build_programs_script=${path_build_programs}script$path_directory_separator
+ path_build_programs_shared=${path_build_programs}shared$path_directory_separator
+ path_build_programs_static=${path_build_programs}static$path_directory_separator
+ path_build_settings=${path_build}settings$path_directory_separator
+
if [[ $verbosity != "quiet" ]] ; then
echo
echo -e "${c_title}Done Processing Operation: $c_reset$c_notice$operation$c_reset"
- if [[ $mode != "" ]] ; then
- echo -e " Modes: $c_reset$c_notice$mode$c_reset"
+ if [[ $modes != "" ]] ; then
+ echo -e " Modes: $c_reset$c_notice$modes$c_reset"
fi
if [[ $defines != "" ]] ; then
echo
fi
- # cleanup and return
+ # cleanup and return.
unset process_post_main
+ unset process_post_path_fix
return 0
}
+process_post_path_fix(){
+ echo -n $* | sed -e "s|^${path_directory_separator}${path_directory_separator}*|${path_directory_separator}|" -e "s|${path_directory_separator}*$|${path_directory_separator}|"
+}
+
# note: "$@" is necessary to preserve quoted arguments when passing though.
process_post_main "$@"
# The purpose of this script is to provide an example for the pre-process part of Fake.
# Despite being an example, it is intended to be actually used when using fake to build the fake project.
#
+# The dependencies of this script are: bash and sed.
+#
process_pre_main(){
local grab_next=
local do_color=normal
local c_subtle="\\033[1;30m"
local c_prefix="\\"
- # the three supported parameters.
+ # the supported parameters.
local operation=
- local mode=
local defines=
+ local modes=
+ local process=
+ local file_settings=
+ local path_build=
+ local path_source_build=
+ local path_source_codes=
+ local path_source_common=
+ local path_source_data=
+ local path_source_documents=
+ local path_source_licenses=
+ local path_source_settings=
+ local path_work=
local verbosity=
+ # standard settings paths.
+ local path_directory_separator="/"
+ local path_build_documents=
+ local path_build_includes=
+ local path_build_libraries=
+ local path_build_libraries_script=
+ local path_build_libraries_shared=
+ local path_build_libraries_static=
+ local path_build_objects=
+ local path_build_process=
+ local path_build_programs=
+ local path_build_programs_script=
+ local path_build_programs_shared=
+ local path_build_programs_static=
+ local path_build_settings=
+
# grab all supported parameters, ignoring duplicates.
if [[ $# -gt 0 ]] ; then
t=$#
if [[ $operation == "" ]] ; then
operation=$p
fi
- elif [[ $p == "-m" ]] ; then
- grab_next="mode"
elif [[ $p == "-d" ]] ; then
grab_next="defines"
+ elif [[ $p == "-m" ]] ; then
+ grab_next="modes"
+ elif [[ $p == "-o" ]] ; then
+ grab_next="process"
+ elif [[ $p == "-s" ]] ; then
+ grab_next="file_settings"
+ elif [[ $p == "-b" ]] ; then
+ grab_next="path_build"
+ elif [[ $p == "-B" ]] ; then
+ grab_next="path_source_build"
+ elif [[ $p == "-C" ]] ; then
+ grab_next="path_source_codes"
+ elif [[ $p == "-O" ]] ; then
+ grab_next="path_source_common"
+ elif [[ $p == "-D" ]] ; then
+ grab_next="path_source_data"
+ elif [[ $p == "-M" ]] ; then
+ grab_next="path_source_documents"
+ elif [[ $p == "-L" ]] ; then
+ grab_next="path_source_licenses"
+ elif [[ $p == "-S" ]] ; then
+ grab_next="path_source_settings"
+ elif [[ $p == "-w" ]] ; then
+ grab_next="path_work"
+ elif [[ $p == "+D" ]] ; then
+ verbosity=debug
elif [[ $p == "+q" ]] ; then
verbosity=quiet
elif [[ $p == "+V" ]] ; then
verbosity=verbose
- elif [[ $p == "+D" ]] ; then
- verbosity=debug
- elif [[ $p == "+n" ]] ; then
- if [[ $do_color == "normal" ]] ; then
- do_color=none
- fi
elif [[ $p == "+l" ]] ; then
if [[ $do_color == "normal" ]] ; then
do_color=light
fi
+ elif [[ $p == "+n" ]] ; then
+ if [[ $do_color == "normal" ]] ; then
+ do_color=none
+ fi
fi
else
- if [[ $grab_next == "mode" ]] ; then
- if [[ $mode == "" ]] ; then
- mode=$p
- else
- mode="$mode $p"
- fi
- elif [[ $grab_next == "defines" ]] ; then
+ if [[ $grab_next == "defines" ]] ; then
if [[ $defines == "" ]] ; then
defines=$p
+ else
+ defines="$defines $p"
+ fi
+ elif [[ $grab_next == "modes" ]] ; then
+ if [[ $modes == "" ]] ; then
+ modes=$p
+ else
+ modes="$modes $p"
fi
+ elif [[ $grab_next == "process" ]] ; then
+ process=$p
+ elif [[ $grab_next == "file_settings" ]] ; then
+ file_settings=$p
+ elif [[ $grab_next == "path_build" ]] ; then
+ path_build=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_source_build" ]] ; then
+ path_source_build=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_source_codes" ]] ; then
+ path_source_codes=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_source_common" ]] ; then
+ path_source_common=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_source_data" ]] ; then
+ path_source_data=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_source_documents" ]] ; then
+ path_source_documents=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_source_licenses" ]] ; then
+ path_source_licenses=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_source_settings" ]] ; then
+ path_source_settings=$(process_pre_path_fix $p)
+ elif [[ $grab_next == "path_work" ]] ; then
+ path_work=$(process_pre_path_fix $p)
fi
grab_next=
c_prefix=
fi
+ # update paths based on parameters.
+ path_build_documents=${path_build}documents$path_directory_separator
+ path_build_includes=${path_build}includes$path_directory_separator
+ path_build_libraries=${path_build}libraries$path_directory_separator
+ path_build_libraries_script=${path_build_libraries}script$path_directory_separator
+ path_build_libraries_shared=${path_build_libraries}shared$path_directory_separator
+ path_build_libraries_static=${path_build_libraries}static$path_directory_separator
+ path_build_objects=${path_build}objects$path_directory_separator
+ path_build_process=${path_build}process$path_directory_separator
+ path_build_programs=${path_build}programs$path_directory_separator
+ path_build_programs_script=${path_build_programs}script$path_directory_separator
+ path_build_programs_shared=${path_build_programs}shared$path_directory_separator
+ path_build_programs_static=${path_build_programs}static$path_directory_separator
+ path_build_settings=${path_build}settings$path_directory_separator
+
if [[ $verbosity != "quiet" ]] ; then
echo
- echo -e "${c_title}Begin Processing Operation: $c_reset$c_notice$operation$c_reset"
+ echo -e "${c_title}Done Processing Operation: $c_reset$c_notice$operation$c_reset"
- if [[ $mode != "" ]] ; then
- echo -e " Modes: $c_reset$c_notice$mode$c_reset"
+ if [[ $modes != "" ]] ; then
+ echo -e " Modes: $c_reset$c_notice$modes$c_reset"
fi
if [[ $defines != "" ]] ; then
echo
fi
- # cleanup and return
+ # cleanup and return.
unset process_pre_main
+ unset process_pre_path_fix
return 0
}
+process_pre_path_fix(){
+ echo -n $* | sed -e "s|^${path_directory_separator}${path_directory_separator}*|${path_directory_separator}|" -e "s|${path_directory_separator}*$|${path_directory_separator}|"
+}
+
# note: "$@" is necessary to preserve quoted arguments when passing though.
process_pre_main "$@"