The object files are not being compiled correctly when performing a static build.
There may now be multiple object sources files which are now built individually.
The build object sources must be built without source code files.
The logic is relocated into a fake_build_library_static_object() function to build the object files.
These files are then included when static linking.
A new build stage is also added to accommodate this.
Building the objects should not include libraries linked.
Remove the logic that auto-adds the library linkage when building objects.
Break out the "path_sources" Object into multiple sub-parts:
- "path_sources_headers".
- "path_sources_library".
- "path_sources_object".
- "path_sources_program".
- "path_sources_script".
Update the documentation and specification files accordingly.
Add missing version dates to the specifications.
Update the bootstrap.sh script with these changes.
Fix incidental problems discovered in the bootstrap.sh script:
- Remove already compiled warning as it is not needed and is not exhaustive.
- Improve handling of directory detection and simplify the relating code.
- The built setting files are now being properly checked (a regression caused them to not be properly checked).
echo -e "${c_highlight}Building:${c_reset} ${c_notice}${project_label}${c_highlight} with modes: ${c_notice}${modes}${c_highlight}.${c_reset}"
fi
- if [[ ! -f ${project_built}.prepared ]] ; then
+ if [[ ! -f ${project_built}-${settings_name}.prepared ]] ; then
bootstrap_prepare_build
if [[ ${?} -ne 0 ]] ; then
"path_program_shared") let key=69;;
"path_program_static") let key=70;;
"path_sources") let key=71;;
- "path_sources_object") let key=72;;
- "preserve_path_headers") let key=73;;
- "process_post") let key=74;;
- "process_pre") let key=75;;
- "search_exclusive") let key=76;;
- "search_shared") let key=77;;
- "search_static") let key=78;;
- "version_file") let key=79;;
- "version_major") let key=80;;
- "version_major_prefix") let key=81;;
- "version_micro") let key=82;;
- "version_micro_prefix") let key=83;;
- "version_minor") let key=84;;
- "version_minor_prefix") let key=85;;
- "version_nano") let key=86;;
- "version_nano_prefix") let key=87;;
- "version_target") let key=88;;
-
- "build_compiler-mode") let key=89;;
- "build_indexer-mode") let key=90;;
- "build_indexer_arguments-mode") let key=91;;
- "build_language-mode") let key=92;;
- "build_libraries-mode") let key=93;;
- "build_libraries_shared-mode") let key=94;;
- "build_libraries_static-mode") let key=95;;
- "build_name-mode") let key=96;;
- "build_objects_library-mode") let key=97;;
- "build_objects_library_shared-mode") let key=98;;
- "build_objects_library_static-mode") let key=99;;
- "build_objects_program-mode") let key=100;;
- "build_objects_program_shared-mode") let key=101;;
- "build_objects_program_static-mode") let key=102;;
- "build_script-mode") let key=103;;
- "build_shared-mode") let key=104;;
- "build_sources_documentation-mode") let key=105;;
- "build_sources_headers-mode") let key=106;;
- "build_sources_headers_shared-mode") let key=107;;
- "build_sources_headers_static-mode") let key=108;;
- "build_sources_library-mode") let key=109;;
- "build_sources_library_shared-mode") let key=110;;
- "build_sources_library_static-mode") let key=111;;
- "build_sources_object-mode") let key=112;;
- "build_sources_object_shared-mode") let key=113;;
- "build_sources_object_static-mode") let key=114;;
- "build_sources_program-mode") let key=115;;
- "build_sources_program_shared-mode") let key=116;;
- "build_sources_program_static-mode") let key=117;;
- "build_sources_script-mode") let key=118;;
- "build_sources_setting-mode") let key=119;;
- "build_static-mode") let key=120;;
- "defines-mode") let key=121;;
- "defines_library-mode") let key=122;;
- "defines_library_shared-mode") let key=123;;
- "defines_library_static-mode") let key=124;;
- "defines_object-mode") let key=125;;
- "defines_object_shared-mode") let key=126;;
- "defines_object_static-mode") let key=127;;
- "defines_program-mode") let key=128;;
- "defines_program_shared-mode") let key=129;;
- "defines_program_static-mode") let key=130;;
- "defines_shared-mode") let key=131;;
- "defines_static-mode") let key=132;;
- "environment-mode") let key=133;;
- "flags-mode") let key=134;;
- "flags_library-mode") let key=135;;
- "flags_library_shared-mode") let key=136;;
- "flags_library_static-mode") let key=137;;
- "flags_object-mode") let key=138;;
- "flags_object_shared-mode") let key=139;;
- "flags_object_static-mode") let key=140;;
- "flags_program-mode") let key=141;;
- "flags_program_shared-mode") let key=142;;
- "flags_program_static-mode") let key=143;;
- "flags_shared-mode") let key=144;;
- "flags_static-mode") let key=145;;
- "has_path_standard-mode") let key=146;;
- "path_headers-mode") let key=147;;
- "path_language-mode") let key=148;;
- "path_library_script-mode") let key=149;;
- "path_library_shared-mode") let key=150;;
- "path_library_static-mode") let key=151;;
- "path_object_script-mode") let key=152;;
- "path_object_shared-mode") let key=153;;
- "path_object_static-mode") let key=154;;
- "path_program_script-mode") let key=155;;
- "path_program_shared-mode") let key=156;;
- "path_program_static-mode") let key=157;;
- "path_sources-mode") let key=158;;
- "path_sources_object-mode") let key=159;;
- "preserve_path_headers-mode") let key=160;;
- "process_post-mode") let key=161;;
- "process_pre-mode") let key=162;;
- "search_exclusive-mode") let key=163;;
- "search_shared-mode") let key=164;;
- "search_static-mode") let key=165;;
- "version_file-mode") let key=166;;
- "version_major-mode") let key=167;;
- "version_major_prefix-mode") let key=168;;
- "version_micro-mode") let key=169;;
- "version_micro_prefix-mode") let key=170;;
- "version_minor-mode") let key=171;;
- "version_minor_prefix-mode") let key=172;;
- "version_nano-mode") let key=173;;
- "version_nano_prefix-mode") let key=174;;
- "version_target-mode") let key=175;;
-
- "has-build_compiler") let key=176;;
- "has-build_indexer") let key=177;;
- "has-build_indexer_arguments") let key=178;;
- "has-build_name") let key=179;;
- "has-has_path_standard") let key=180;;
- "has-path_library_script") let key=181;;
- "has-path_library_shared") let key=182;;
- "has-path_library_static") let key=183;;
- "has-path_object_script") let key=184;;
- "has-path_object_shared") let key=185;;
- "has-path_object_static") let key=186;;
- "has-path_program_script") let key=187;;
- "has-path_program_shared") let key=188;;
- "has-path_program_static") let key=189;;
- "has-path_sources") let key=190;;
- "has-path_sources_object") let key=191;;
- "has-search_exclusive") let key=192;;
- "has-search_shared") let key=193;;
- "has-search_static") let key=194;;
- "has-version_major_prefix") let key=195;;
- "has-version_micro_prefix") let key=196;;
- "has-version_minor_prefix") let key=197;;
- "has-version_nano_prefix") let key=198;;
-
- "has-build_compiler-mode") let key=199;;
- "has-build_indexer-mode") let key=200;;
- "has-build_indexer_arguments-mode") let key=201;;
- "has-build_name-mode") let key=202;;
- "has-has_path_standard-mode") let key=203;;
- "has-path_library_script-mode") let key=204;;
- "has-path_library_shared-mode") let key=205;;
- "has-path_library_static-mode") let key=206;;
- "has-path_object_script-mode") let key=207;;
- "has-path_object_shared-mode") let key=208;;
- "has-path_object_static-mode") let key=209;;
- "has-path_program_script-mode") let key=210;;
- "has-path_program_shared-mode") let key=211;;
- "has-path_program_static-mode") let key=212;;
- "has-path_sources-mode") let key=213;;
- "has-path_sources_object-mode") let key=214;;
- "has-search_exclusive-mode") let key=215;;
- "has-search_shared-mode") let key=216;;
- "has-search_static-mode") let key=217;;
- "has-version_major_prefix-mode") let key=218;;
- "has-version_micro_prefix-mode") let key=219;;
- "has-version_minor_prefix-mode") let key=220;;
- "has-version_nano_prefix-mode") let key=221;;
+ "path_sources_headers") let key=72;;
+ "path_sources_library") let key=73;;
+ "path_sources_object") let key=74;;
+ "path_sources_program") let key=75;;
+ "path_sources_script") let key=76;;
+ "preserve_path_headers") let key=77;;
+ "process_post") let key=78;;
+ "process_pre") let key=79;;
+ "search_exclusive") let key=80;;
+ "search_shared") let key=81;;
+ "search_static") let key=82;;
+ "version_file") let key=83;;
+ "version_major") let key=84;;
+ "version_major_prefix") let key=85;;
+ "version_micro") let key=86;;
+ "version_micro_prefix") let key=87;;
+ "version_minor") let key=88;;
+ "version_minor_prefix") let key=89;;
+ "version_nano") let key=90;;
+ "version_nano_prefix") let key=91;;
+ "version_target") let key=92;;
+
+ "build_compiler-mode") let key=93;;
+ "build_indexer-mode") let key=94;;
+ "build_indexer_arguments-mode") let key=95;;
+ "build_language-mode") let key=96;;
+ "build_libraries-mode") let key=97;;
+ "build_libraries_shared-mode") let key=98;;
+ "build_libraries_static-mode") let key=99;;
+ "build_name-mode") let key=100;;
+ "build_objects_library-mode") let key=101;;
+ "build_objects_library_shared-mode") let key=102;;
+ "build_objects_library_static-mode") let key=103;;
+ "build_objects_program-mode") let key=104;;
+ "build_objects_program_shared-mode") let key=105;;
+ "build_objects_program_static-mode") let key=106;;
+ "build_script-mode") let key=107;;
+ "build_shared-mode") let key=108;;
+ "build_sources_documentation-mode") let key=109;;
+ "build_sources_headers-mode") let key=110;;
+ "build_sources_headers_shared-mode") let key=111;;
+ "build_sources_headers_static-mode") let key=112;;
+ "build_sources_library-mode") let key=113;;
+ "build_sources_library_shared-mode") let key=114;;
+ "build_sources_library_static-mode") let key=115;;
+ "build_sources_object-mode") let key=116;;
+ "build_sources_object_shared-mode") let key=117;;
+ "build_sources_object_static-mode") let key=118;;
+ "build_sources_program-mode") let key=119;;
+ "build_sources_program_shared-mode") let key=120;;
+ "build_sources_program_static-mode") let key=121;;
+ "build_sources_script-mode") let key=122;;
+ "build_sources_setting-mode") let key=123;;
+ "build_static-mode") let key=124;;
+ "defines-mode") let key=125;;
+ "defines_library-mode") let key=126;;
+ "defines_library_shared-mode") let key=127;;
+ "defines_library_static-mode") let key=128;;
+ "defines_object-mode") let key=129;;
+ "defines_object_shared-mode") let key=130;;
+ "defines_object_static-mode") let key=131;;
+ "defines_program-mode") let key=132;;
+ "defines_program_shared-mode") let key=133;;
+ "defines_program_static-mode") let key=134;;
+ "defines_shared-mode") let key=135;;
+ "defines_static-mode") let key=136;;
+ "environment-mode") let key=137;;
+ "flags-mode") let key=138;;
+ "flags_library-mode") let key=139;;
+ "flags_library_shared-mode") let key=140;;
+ "flags_library_static-mode") let key=141;;
+ "flags_object-mode") let key=142;;
+ "flags_object_shared-mode") let key=143;;
+ "flags_object_static-mode") let key=144;;
+ "flags_program-mode") let key=145;;
+ "flags_program_shared-mode") let key=146;;
+ "flags_program_static-mode") let key=147;;
+ "flags_shared-mode") let key=148;;
+ "flags_static-mode") let key=149;;
+ "has_path_standard-mode") let key=150;;
+ "path_headers-mode") let key=151;;
+ "path_language-mode") let key=152;;
+ "path_library_script-mode") let key=153;;
+ "path_library_shared-mode") let key=154;;
+ "path_library_static-mode") let key=155;;
+ "path_object_script-mode") let key=156;;
+ "path_object_shared-mode") let key=157;;
+ "path_object_static-mode") let key=158;;
+ "path_program_script-mode") let key=159;;
+ "path_program_shared-mode") let key=160;;
+ "path_program_static-mode") let key=161;;
+ "path_sources-mode") let key=162;;
+ "path_sources_headers-mode") let key=163;;
+ "path_sources_library-mode") let key=164;;
+ "path_sources_object-mode") let key=165;;
+ "path_sources_program-mode") let key=166;;
+ "path_sources_script-mode") let key=167;;
+ "preserve_path_headers-mode") let key=168;;
+ "process_post-mode") let key=169;;
+ "process_pre-mode") let key=170;;
+ "search_exclusive-mode") let key=171;;
+ "search_shared-mode") let key=172;;
+ "search_static-mode") let key=173;;
+ "version_file-mode") let key=174;;
+ "version_major-mode") let key=175;;
+ "version_major_prefix-mode") let key=176;;
+ "version_micro-mode") let key=177;;
+ "version_micro_prefix-mode") let key=178;;
+ "version_minor-mode") let key=179;;
+ "version_minor_prefix-mode") let key=180;;
+ "version_nano-mode") let key=181;;
+ "version_nano_prefix-mode") let key=182;;
+ "version_target-mode") let key=183;;
+
+ "has-build_compiler") let key=184;;
+ "has-build_indexer") let key=185;;
+ "has-build_indexer_arguments") let key=186;;
+ "has-build_name") let key=187;;
+ "has-has_path_standard") let key=188;;
+ "has-path_library_script") let key=189;;
+ "has-path_library_shared") let key=190;;
+ "has-path_library_static") let key=191;;
+ "has-path_object_script") let key=192;;
+ "has-path_object_shared") let key=193;;
+ "has-path_object_static") let key=194;;
+ "has-path_program_script") let key=195;;
+ "has-path_program_shared") let key=196;;
+ "has-path_program_static") let key=197;;
+ "has-path_sources") let key=198;;
+ "has-path_sources_headers") let key=199;;
+ "has-path_sources_library") let key=200;;
+ "has-path_sources_object") let key=201;;
+ "has-path_sources_program") let key=202;;
+ "has-path_sources_script") let key=203;;
+ "has-search_exclusive") let key=204;;
+ "has-search_shared") let key=205;;
+ "has-search_static") let key=206;;
+ "has-version_major_prefix") let key=207;;
+ "has-version_micro_prefix") let key=208;;
+ "has-version_minor_prefix") let key=209;;
+ "has-version_nano_prefix") let key=210;;
+
+ "has-build_compiler-mode") let key=207;;
+ "has-build_indexer-mode") let key=208;;
+ "has-build_indexer_arguments-mode") let key=209;;
+ "has-build_name-mode") let key=210;;
+ "has-has_path_standard-mode") let key=211;;
+ "has-path_library_script-mode") let key=212;;
+ "has-path_library_shared-mode") let key=213;;
+ "has-path_library_static-mode") let key=214;;
+ "has-path_object_script-mode") let key=215;;
+ "has-path_object_shared-mode") let key=216;;
+ "has-path_object_static-mode") let key=217;;
+ "has-path_program_script-mode") let key=218;;
+ "has-path_program_shared-mode") let key=219;;
+ "has-path_program_static-mode") let key=220;;
+ "has-path_sources-mode") let key=221;;
+ "has-path_sources_headers-mode") let key=222;;
+ "has-path_sources_library-mode") let key=223;;
+ "has-path_sources_object-mode") let key=224;;
+ "has-path_sources_program-mode") let key=225;;
+ "has-path_sources_script-mode") let key=226;;
+ "has-search_exclusive-mode") let key=227;;
+ "has-search_shared-mode") let key=228;;
+ "has-search_static-mode") let key=229;;
+ "has-version_major_prefix-mode") let key=230;;
+ "has-version_micro_prefix-mode") let key=231;;
+ "has-version_minor_prefix-mode") let key=232;;
+ "has-version_nano_prefix-mode") let key=233;;
esac
}
fi
# Single value Objects.
- for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_object preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
+ for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
bootstrap_id "${i}"
for m in ${modes} ; do
# Single value Objects.
- for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_object preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
+ for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do
bootstrap_id "${i}-mode"
bootstrap_id "path_program_static"
local path_program_static=${variables[${key}]}
+ bootstrap_id "path_sources_headers"
+ local path_sources_headers=${variables[${key}]}
+
+ bootstrap_id "path_sources_library"
+ local path_sources_library=${variables[${key}]}
+
+ bootstrap_id "path_sources_object"
+ local path_sources_object=${variables[${key}]}
+
+ bootstrap_id "path_sources_program"
+ local path_sources_program=${variables[${key}]}
+
+ bootstrap_id "path_sources_script"
+ local path_sources_script=${variables[${key}]}
+
bootstrap_id "has_path_standard"
local has_path_standard=${variables[${key}]}
bootstrap_operation_build_prepare_remaining
- if [[ ${build_shared} == "yes" && -f ${project_built_shared}.built || ${build_static} == "yes" && -f ${project_built_static}.built ]] ; then
- if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- echo -e "${c_warning}WARNING: This project has already been built.${c_reset}"
- fi
-
- return 0
- fi
-
local arguments_include="-I${path_build}includes/"
local arguments_shared="-L${path_build}libraries/${path_library_shared}"
local arguments_static="-L${path_build}libraries/${path_library_static}"
if [[ ${sources_documentation} != "" ]] ; then
for i in ${sources_documentation} ; do
+
directory=$(dirname ${i})
+ if [[ ${directory} == "." ]] ; then
+ directory=
+ elif [[ ${directory} != "" ]] ; then
+ directory="${directory}/"
+ fi
if [[ ! -e ${path_documentation}${i} ]] ; then
if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
continue;
fi
- if [[ ${directory} == "." ]] ; then
- cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/ || failure=1
- else
+ if [[ ! -d ${path_build}documentation/${directory} ]] ; then
mkdir ${verbose_common} -p ${path_build}documentation/${directory} || failure=1
+ fi
- if [[ ${failure} -eq 0 ]] ; then
- cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/${directory}/ || failure=1
- fi
+ if [[ ${failure} -eq 0 ]] ; then
+ cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/${directory} || failure=1
fi
done
fi
if [[ ${sources_setting} != "" ]] ; then
for i in ${sources_setting} ; do
- directory=$(dirname ${i})
+ directory=$(dirname ${i})
if [[ ${directory} == "." ]] ; then
- cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/ || failure=1
- else
+ directory=
+ elif [[ ${directory} != "" ]] ; then
+ directory="${directory}/"
+ fi
+
+ if [[ ! -d ${path_build}settings/${directory} ]] ; then
mkdir ${verbose_common} -p ${path_build}settings/${directory} || failure=1
+ fi
- if [[ ${failure} -eq 0 ]] ; then
- cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/${directory}/ || failure=1
- fi
+ if [[ ${failure} -eq 0 ]] ; then
+ cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/${directory} || failure=1
fi
done
fi
if [[ ${failure} -eq 0 && ${sources_headers} != "" ]] ; then
if [[ ${preserve_path_headers} == "yes" ]] ; then
for i in ${sources_headers} ; do
- directory=$(dirname ${i})
+ directory=$(dirname ${i})
if [[ ${directory} == "." ]] ; then
- cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1
- else
- if [[ ! -d ${path_build}includes/${path_headers}${directory} ]] ; then
- mkdir ${verbose_common} -p ${path_build}includes/${path_headers}${directory} || failure=1
- fi
+ directory=
+ elif [[ ${directory} != "" ]] ; then
+ directory="${directory}/"
+ fi
- if [[ ${failure} -eq 0 ]] ; then
- cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers}${i} || failure=1
- fi
+ if [[ ! -d ${path_build}includes/${path_headers}${directory} ]] ; then
+ mkdir ${verbose_common} -p ${path_build}includes/${path_headers}${directory} || failure=1
+ fi
+
+ if [[ ${failure} -eq 0 ]] ; then
+ cp ${verbose_common} -f ${path_sources_headers}${path_language}${i} ${path_build}includes/${path_headers}${directory} || failure=1
fi
done
else
for i in ${sources_headers} ; do
- cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1
+ cp ${verbose_common} -f ${path_sources_headers}${path_language}${i} ${path_build}includes/${path_headers} || failure=1
done
fi
fi
- if [[ ${failure} -eq 0 && ${build_shared} == "yes" && ! -f ${project_built_shared}.built ]] ; then
+ if [[ ${failure} -eq 0 && ${build_shared} == "yes" && ! -f ${project_built_shared}-${settings_name}.built ]] ; then
if [[ ${sources_object} != "" || ${sources_object_shared} != "" ]] ; then
- sources=
- let count=0
-
- # Sources object only allows for a single value.
- if [[ ${sources_object_shared} != "" ]] ; then
- for i in ${sources_object_shared} ; do
- let count++
- done
+ for i in ${sources_object} ${sources_object_shared} ; do
- if [[ ${count} -gt 1 ]] ; then
- if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object_shared${c_warning}' found, only using the first one found is going to be used.${c_reset}"
- fi
+ directory=$(dirname ${i})
+ if [[ ${directory} == "." ]] ; then
+ directory=
+ elif [[ ${directory} != "" ]] ; then
+ directory="${directory}/"
fi
- for i in ${sources_object_shared} ; do
- sources="${path_sources_object}${path_language}${i} "
+ if [[ ! -d ${path_build}objects/${path_object_shared}${directory} ]] ; then
+ mkdir ${verbose_common} -p ${path_build}objects/${path_object_shared}${directory} || failure=1
+ fi
- break
- done
- else
- for i in ${sources_object} ; do
- let count++
- done
+ sources="${path_sources_object}${path_language}${i} "
+ n=$(echo $i | sed -e 's|\.[^\.]*$||')
- if [[ ${count} -gt 1 ]] ; then
- if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object${c_warning}' found, only using the first one found is going to be used.${c_reset}"
- fi
+ if [[ ${verbosity} == "verbose" ]] ; then
+ echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${n}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra}
fi
- for i in ${sources_object} ; do
- sources="${path_sources_object}${path_language}${i} "
+ ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${n}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} || failure=1
+ if [[ ${failure} -ne 0 ]] ; then
break
- done
- fi
-
- if [[ ${verbosity} == "verbose" ]] ; then
- echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${build_name}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra}
- fi
-
- ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${build_name}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} || failure=1
+ fi
+ done
fi
- if [[ ${sources_library} != "" || ${sources_library_shared} != "" ]] ; then
+ if [[ ${failure} -eq 0 && (${sources_library} != "" || ${sources_library_shared} != "") ]] ; then
sources=
if [[ ${objects_library} != "" || ${objects_library_shared} != "" ]] ; then
fi
for i in ${sources_library} ${sources_library_shared} ; do
- sources="${sources}${path_sources}${path_language}${i} "
+ sources="${sources}${path_sources_library}${path_language}${i} "
done
if [[ ${verbosity} == "verbose" ]] ; then
fi
fi
- if [[ ${failure} -eq 0 && ${sources_program} != "" ]] ; then
+ if [[ ${failure} -eq 0 && (${sources_program} != "" || ${sources_program_shared} != "") ]] ; then
sources=
links=
fi
for i in ${sources_program} ${sources_program_shared} ; do
- sources="${sources}${path_sources}${path_language}${i} "
+ sources="${sources}${path_sources_program}${path_language}${i} "
done
if [[ ${verbosity} == "verbose" ]] ; then
fi
fi
- if [[ ${failure} -eq 0 && ${build_static} == "yes" && ! -f ${project_built_static}.built ]] ; then
+ if [[ ${failure} -eq 0 && ${build_static} == "yes" && ! -f ${project_built_static}-${settings_name}.built ]] ; then
if [[ ${sources_object} != "" || ${sources_object_static} != "" ]] ; then
- let count=0
+ for i in ${sources_object} ${sources_object_static} ; do
- # Sources object only allows for a single value.
- if [[ ${sources_object_static} != "" ]] ; then
- for i in ${sources_object_static} ; do
- let count++
- done
+ directory=$(dirname ${i})
+ if [[ ${directory} == "." ]] ; then
+ directory=
+ elif [[ ${directory} != "" ]] ; then
+ directory="${directory}/"
+ fi
- if [[ ${count} -gt 1 ]] ; then
- if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object_static${c_warning}' found, only using the first one found is going to be used.${c_reset}"
- fi
+ if [[ ! -d ${path_build}objects/${path_object_shared}${directory} ]] ; then
+ mkdir ${verbose_common} -p ${path_build}objects/${path_object_shared}${directory} || failure=1
fi
- for i in ${sources_object_static} ; do
- sources="${path_sources_object}${path_language}${i} "
+ sources="${path_sources_object}${path_language}${i} "
+ n=$(echo $i | sed -e 's|\.[^\.]*$||')
- break
- done
- else
- for i in ${sources_object} ; do
- let count++
- done
-
- if [[ ${count} -gt 1 ]] ; then
- if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then
- echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object${c_warning}' found, only using the first one found is going to be used.${c_reset}"
- fi
+ if [[ ${verbosity} == "verbose" ]] ; then
+ echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra}
fi
- for i in ${sources_object} ; do
- sources="${path_sources_object}${path_language}${i} "
+ ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} || failure=1
+ if [[ ${failure} -ne 0 ]] ; then
break
- done
- fi
-
- if [[ ${verbosity} == "verbose" ]] ; then
- echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${build_name}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra}
- fi
-
- ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${build_name}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} || failure=1
+ fi
+ done
fi
if [[ ${sources_library} != "" || ${sources_library_static} != "" ]] ; then
fi
for i in ${sources_library} ${sources_library_static} ; do
+
directory=$(dirname ${i})
- n=$(basename ${i} | sed -e 's|\.c$||')
+ if [[ ${directory} == "." ]] ; then
+ directory=
+ elif [[ ${directory} != "" ]] ; then
+ directory="${directory}/"
+ fi
- if [[ ${directory} != "." && ! -d ${path_build}objects/${directory} ]] ; then
- mkdir ${verbose_common} -p ${path_build}objects/${directory}
+ n=$(basename ${i} | sed -e 's|\.[^\.]*$||')
- if [[ ${?} -ne 0 ]] ; then
- let failure=1
+ if [[ ! -d ${path_build}objects/${directory} ]] ; then
+ mkdir ${verbose_common} -p ${path_build}objects/${directory} || failure=1
+ if [[ ${failure} -eq 1 ]] ; then
break;
fi
fi
# These are objects created by the static build step rather than objects created by the object build step.
- sources="${sources}${path_build}objects/${directory}/${n}.o "
+ sources="${sources}${path_build}objects/${directory}${n}.o "
if [[ ${verbosity} == "verbose" ]] ; then
- echo ${build_compiler} ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra}
+ echo ${build_compiler} ${path_sources_library}${path_language}${i} -c -static -o ${path_build}objects/${directory}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra}
fi
- ${build_compiler} ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} || failure=1
+ ${build_compiler} ${path_sources_library}${path_language}${i} -c -static -o ${path_build}objects/${directory}${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} || failure=1
if [[ ${failure} -eq 1 ]] ; then
break;
fi
fi
- if [[ ${failure} -eq 0 && ${sources_program} != "" ]] ; then
+ if [[ ${failure} -eq 0 && (${sources_program} != "" || ${sources_program_static} != "") ]] ; then
sources=
links=
fi
for i in ${sources_program} ${sources_program_static} ; do
- sources="${sources}${path_sources}${path_language}${i} "
+ sources="${sources}${path_sources_program}${path_language}${i} "
done
if [[ ${verbosity} == "verbose" ]] ; then
fi
fi
+ bootstrap_id "has-path_sources_headers-mode"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+
+ bootstrap_id "has-path_sources_headers"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+ path_sources_headers=${path_sources}
+ fi
+ fi
+
+ bootstrap_id "has-path_sources_library-mode"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+
+ bootstrap_id "has-path_sources_library"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+ path_sources_library=${path_sources}
+ fi
+ fi
+
bootstrap_id "has-path_sources_object-mode"
if [[ ${variables[${key}]} != "yes" ]] ; then
bootstrap_id "has-path_sources_object"
if [[ ${variables[${key}]} != "yes" ]] ; then
- path_sources_object="sources/"
+ path_sources_object=${path_sources}
+ fi
+ fi
+
+ bootstrap_id "has-path_sources_program-mode"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+
+ bootstrap_id "has-path_sources_program"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+ path_sources_program=${path_sources}
+ fi
+ fi
+
+ bootstrap_id "has-path_sources_script-mode"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+
+ bootstrap_id "has-path_sources_script"
+ if [[ ${variables[${key}]} != "yes" ]] ; then
+ path_sources_script=${path_sources}
fi
fi
fi
done
- if [[ -f ${project_built}.prepared ]] ; then
+ if [[ -f ${project_built}-${settings_name}.prepared ]] ; then
rm ${verbose_common} -f ${project_built}-${settings_name}.prepared
fi
build_sources_program fll/level_2/program.c fll/level_2/program/common.c fll/level_2/program/print.c fll/level_2/private-program.c
build_sources_program program/fake/main/build.c program/fake/main/clean.c program/fake/main/common.c program/fake/main/fake.c program/fake/main/make.c program/fake/main/print/common.c program/fake/main/print/context.c program/fake/main/print/error.c program/fake/main/print/message.c program/fake/main/print/operation.c program/fake/main/print/warning.c program/fake/main/print/verbose.c program/fake/main/signal.c program/fake/main/skeleton.c program/fake/main/thread.c
-build_sources_program program/fake/main/build/enumeration.c program/fake/main/build/library.c program/fake/main/build/load.c program/fake/main/build/object.c program/fake/main/build/objects.c program/fake/main/build/print/compile.c program/fake/main/build/print/error.c program/fake/main/build/print/message.c program/fake/main/build/print/verbose.c program/fake/main/build/print/warning.c program/fake/main/build/program.c program/fake/main/build/skeleton.c program/fake/main/build/string.c
+build_sources_program program/fake/main/build/enumeration.c program/fake/main/build/library.c program/fake/main/build/load.c program/fake/main/build/object.c program/fake/main/build/print/compile.c program/fake/main/build/print/error.c program/fake/main/build/print/message.c program/fake/main/build/print/verbose.c program/fake/main/build/print/warning.c program/fake/main/build/program.c program/fake/main/build/skeleton.c program/fake/main/build/string.c
build_sources_program program/fake/main/common/define.c program/fake/main/common/enumeration.c program/fake/main/common/print.c program/fake/main/common/string.c program/fake/main/common/type.c
build_sources_program program/fake/main/fake/path_generate.c program/fake/main/fake/do.c
build_sources_program program/fake/main/make/load_fakefile.c program/fake/main/make/load_parameters.c program/fake/main/make/operate_block.c program/fake/main/make/operate.c program/fake/main/make/operate_process.c program/fake/main/make/operate_process_type.c program/fake/main/make/operate_validate.c program/fake/main/make/operate_validate_type.c program/fake/main/make/print/error.c program/fake/main/make/print/message.c program/fake/main/make/print/verbose.c program/fake/main/make/print/warning.c
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, GNU LGPL Version 2.1 or later.
+Copyright \(co 2007-2024 Kevin Day, GNU LGPL Version 2.1 or later.
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
}
{
+ f_string_statics_t empty = f_string_statics_t_initialize;
+
f_string_statics_t * const strings[] = {
- &data_build->setting.build_libraries,
- (is_shared) ? &data_build->setting.build_libraries_shared : &data_build->setting.build_libraries_static,
+ (type == fake_build_type_object_e) ? &empty : &data_build->setting.build_libraries,
+ (type == fake_build_type_object_e)
+ ? &empty
+ : (is_shared)
+ ? &data_build->setting.build_libraries_shared
+ : &data_build->setting.build_libraries_static,
&data_build->setting.flags,
(is_shared) ? &data_build->setting.flags_shared : &data_build->setting.flags_static,
(type == fake_build_type_library_e)
}
if (data_build.setting.build_shared) {
- main->program.child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared);
+ main->program.child = fake_build_object(data, &data_build, mode, stage.file_object_shared, F_true);
main->program.child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared);
}
if (data_build.setting.build_static) {
- main->program.child = fake_build_object_static(data, &data_build, mode, stage.file_object_static);
+ main->program.child = fake_build_object(data, &data_build, mode, stage.file_object_static, F_false);
- main->program.child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static);
+ main->program.child = fake_build_library_static_object(data, &data_build, mode, stage.file_library_static_object);
main->program.child = fake_build_library_static(data, &data_build, mode, stage.file_library_static);
main->setting.state.status = f_string_dynamic_append_nulless(*setting_path_source, source);
- // @todo add additional languages, java, etc..?
if (F_status_is_error_not(main->setting.state.status) && data_build->setting.has_path_standard) {
if (data_build->setting.build_language == fake_build_language_c_e) {
main->setting.state.status = f_string_dynamic_append_nulless(fake_build_language_c_s, source);
* Errors (with error bit) from: fake_build_object_script()
* Errors (with error bit) from: fake_build_object_shared()
* Errors (with error bit) from: fake_build_object_static()
- * Errors (with error bit) from: fake_build_objects_static()
* Errors (with error bit) from: fake_build_program_script()
* Errors (with error bit) from: fake_build_program_shared()
* Errors (with error bit) from: fake_build_program_static()
+ * Errors (with error bit) from: fake_build_library_static_object()
* Errors (with error bit) from: fake_build_skeleton()
* @param setting_file
* The name of the settings file to use.
* @see fake_build_load_environment()
* @see fake_build_load_setting()
* @see fake_build_load_stage()
+ * @see fake_build_object()
* @see fake_build_object_script()
- * @see fake_build_object_shared()
- * @see fake_build_object_static()
- * @see fake_build_objects_static()
+ * @see fake_build_program_object_static()
* @see fake_build_program_script()
* @see fake_build_program_shared()
* @see fake_build_program_static()
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add));
- return 0;
+ break;
}
} // for
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add));
-
- return 0;
}
}
}
if (F_status_is_error_not(main->setting.state.status)) {
+ fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(fake_build_objects_add));
+ }
+ }
+
+ if (F_status_is_error_not(main->setting.state.status)) {
f_number_unsigned_t j = 0;
const f_string_dynamics_t *sources[2] = {
fake_string_dynamic_reset(&main->cache_argument);
if (main->cache_2.used) {
- main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects, &main->cache_2);
+ main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects_static, &main->cache_2);
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_prepend));
}
}
else {
- main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects, &main->cache_argument);
+ main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_static, &main->cache_argument);
if (F_status_is_error_not(main->setting.state.status)) {
main->setting.state.status = f_string_dynamic_append_nulless(main->cache_1, &main->cache_argument);
}
#endif // _di_fake_build_library_static_
+#ifndef _di_fake_build_library_static_object_
+ int fake_build_library_static_object(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
+
+ if (!data || !data->main || !data_build) return 0;
+ if (data->main->setting.state.status == F_child) return data->main->program.child;
+ if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
+ if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0;
+
+ fake_main_t * const main = data->main;
+
+ fake_build_print_compile_library_static_object(&main->program.message);
+
+ fake_string_dynamics_reset(&main->cache_arguments);
+
+ int result = main->program.child;
+
+ const f_string_dynamics_t *sources[2] = {
+ &data_build->setting.build_sources_library,
+ &data_build->setting.build_sources_library_static,
+ };
+
+ f_number_unsigned_t i = 0;
+ f_number_unsigned_t j = 0;
+ uint8_t k = 0;
+
+ for (i = 0; i < 2; ++i) {
+
+ for (j = 0; j < sources[i]->used; ++j) {
+
+ if (!sources[i]->array[j].used) continue;
+
+ fake_string_dynamic_reset(&main->cache_1);
+ fake_string_dynamic_reset(&main->cache_2);
+ fake_string_dynamic_reset(&main->cache_argument);
+ fake_string_dynamics_reset(&main->cache_arguments);
+
+ fake_build_path_source_string(data, data_build, &data_build->setting.path_sources_library, &main->cache_1);
+ if (F_status_is_error(main->setting.state.status)) break;
+
+ main->setting.state.status = f_string_dynamic_append_nulless(sources[i]->array[j], &main->cache_1);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless));
+
+ return 0;
+ }
+
+ fake_build_get_file_name_without_extension(data, sources[i]->array[j], &main->cache_2);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(fake_build_get_file_name_without_extension));
+
+ break;
+ }
+
+ main->setting.state.status = f_file_name_directory(sources[i]->array[j], &main->cache_argument);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory));
+
+ break;
+ }
+
+ if (main->cache_argument.used) {
+ main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects_static, &main->cache_argument);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_prepend));
+
+ break;
+ }
+
+ main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_argument);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure));
+
+ break;
+ }
+
+ main->setting.state.status = f_directory_exists(main->cache_argument);
+
+ if (main->setting.state.status == F_false) {
+ fake_build_print_error_exist_not_directory(&main->program.message, main->cache_argument);
+
+ main->setting.state.status = F_status_set_error(F_failure);
+
+ break;
+ }
+
+ if (main->setting.state.status == F_file_found_not) {
+ main->setting.state.status = f_directory_create(main->cache_argument, mode.directory);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ if (F_status_set_fine(main->setting.state.status) == F_file_found_not) {
+ fake_build_print_error_cannot_create_due_to_parent(&main->program.message, main->cache_argument);
+ }
+ else {
+ fake_print_error_file(&main->program.error, macro_fake_f(f_directory_create), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
+ }
+
+ break;
+ }
+
+ fake_build_print_verbose_create_directory(&main->program.message, main->cache_argument);
+ }
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error_file(&main->program.error, macro_fake_f(f_directory_exists), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
+
+ break;
+ }
+ }
+
+ if (main->cache_argument.used) {
+ main->setting.state.status = F_okay;
+ }
+ else {
+ main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_static, &main->cache_argument);
+ }
+
+ if (F_status_is_error_not(main->setting.state.status)) {
+ main->setting.state.status = f_string_dynamic_append_nulless(main->cache_2, &main->cache_argument);
+ }
+
+ if (F_status_is_error_not(main->setting.state.status)) {
+ main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument);
+ }
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless));
+
+ return 0;
+ }
+
+ const f_string_static_t values[] = {
+ main->cache_1,
+ fake_build_parameter_object_compile_s,
+ fake_build_parameter_object_static_s,
+ fake_build_parameter_object_output_s,
+ main->cache_argument,
+ };
+
+ for (k = 0; k < 5; ++k) {
+
+ if (!values[k].used) continue;
+
+ main->setting.state.status = fll_execute_arguments_add(values[k], &main->cache_arguments);
+ if (F_status_is_error(main->setting.state.status)) break;
+ } // for
+
+ fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add));
+
+ break;
+ }
+
+ result = fake_execute(data, data_build->environment, data_build->setting.build_compiler);
+
+ if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) break;
+ } // for
+
+ if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) break;
+ } // for
+
+ if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) {
+ fake_build_touch(data, file_stage);
+ }
+
+ return result;
+ }
+#endif // _di_fake_build_library_static_object_
+
#ifdef __cplusplus
} // extern "C"
#endif
* @see fll_execute_arguments_add()
*
* @see fake_build_get_file_name_without_extension()
+ * @see fake_build_objects_add()
* @see fake_build_print_compile_library_static()
* @see fake_build_touch()
* @see fake_execute()
extern int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage);
#endif // _di_fake_build_library_static_
+/**
+ * Build the static libraries objects.
+ *
+ * @param data
+ * The program data.
+ *
+ * This modifies data.main.cache_1.
+ * This modifies data.main.cache_2.
+ * This modifies data.main.cache_argument.
+ * This modifies data.main.cache_arguments.
+ *
+ * This alters data.main->setting.state.status:
+ * F_okay on success.
+ *
+ * Errors (with error bit) from: f_file_name_directory()
+ * Errors (with error bit) from: f_string_dynamic_append_assure()
+ * Errors (with error bit) from: f_string_dynamic_prepend()
+ * Errors (with error bit) from: fll_execute_arguments_add()
+ *
+ * Errors (with error bit) from: fake_build_get_file_name_without_extension()
+ * Errors (with error bit) from: fake_build_print_compile_library_static()
+ * Errors (with error bit) from: fake_build_touch()
+ * Errors (with error bit) from: fake_execute()
+ * @param data_build
+ * The build data.
+ * @param mode
+ * The file mode.
+ * @param file_stage
+ * The specific stage file path.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @return
+ * The return code of the execution process.
+ * This generally is only needed when F_child is returned, where this holds the return status of the child process.
+ *
+ * @see f_file_name_directory()
+ * @see f_string_dynamic_append_assure()
+ * @see f_string_dynamic_prepend()
+ * @see fll_execute_arguments_add()
+ *
+ * @see fake_build_get_file_name_without_extension()
+ * @see fake_build_print_compile_library_static()
+ * @see fake_build_touch()
+ * @see fake_execute()
+ */
+#ifndef _di_fake_build_library_static_object_
+ extern int fake_build_library_static_object(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage);
+#endif // _di_fake_build_library_static_object_
+
#ifdef __cplusplus
} // extern "C"
#endif
fake_build_stage_library_script_s,
fake_build_stage_library_shared_s,
fake_build_stage_library_static_s,
+ fake_build_stage_library_static_object_s,
fake_build_stage_object_script_s,
fake_build_stage_object_shared_s,
fake_build_stage_object_static_s,
&stage->file_library_script,
&stage->file_library_shared,
&stage->file_library_static,
+ &stage->file_library_static_object,
&stage->file_object_script,
&stage->file_object_shared,
&stage->file_object_static,
}
#endif // _di_fake_build_object_script_
-#ifndef _di_fake_build_object_shared_
- int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
+#ifndef _di_fake_build_object_
+ int fake_build_object(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, const uint8_t shared) {
if (!data || !data->main || !data_build) return 0;
if (data->main->setting.state.status == F_child) return data->main->program.child;
if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
- if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0;
+ if (!data_build->setting.build_sources_object.used && (shared && !data_build->setting.build_sources_object_shared.used || !shared && !data_build->setting.build_sources_object_static.used)) return 0;
fake_main_t * const main = data->main;
const f_string_dynamics_t *sources[2] = {
&data_build->setting.build_sources_object,
- &data_build->setting.build_sources_object_shared,
+ shared ? &data_build->setting.build_sources_object_shared : &data_build->setting.build_sources_object_static,
};
- fake_build_print_compile_object_shared(&main->program.message);
+ if (shared) {
+ fake_build_print_compile_object_shared(&main->program.message);
+ }
+ else {
+ fake_build_print_compile_object_static(&main->program.message);
+ }
for (i = 0; i < 2; ++i) {
- for (j = 0; j < sources[i]->used; ++j) {
+ for (j = 0; j < sources[i]->used && F_status_is_error_not(main->setting.state.status); ++j) {
fake_string_dynamic_reset(&main->cache_argument);
fake_string_dynamics_reset(&main->cache_arguments);
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(fake_build_sources_object_add));
- return 0;
+ break;
}
fake_string_dynamic_reset(&main->cache_argument);
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(fake_build_get_file_name_without_extension));
- return 0;
+ break;
}
main->setting.state.status = f_file_name_directory(sources[i]->array[j], &main->cache_2);
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory));
- return 0;
+ break;
}
main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_2);
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure));
- return 0;
+ break;
}
- main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_shared, &main->cache_argument);
+ main->setting.state.status = f_string_dynamic_append_nulless(shared ? data->path_build_objects_shared : data->path_build_objects_static, &main->cache_argument);
if (F_status_is_error_not(main->setting.state.status)) {
main->setting.state.status = f_string_dynamic_append_nulless(main->cache_2, &main->cache_argument);
}
- main->setting.state.status = f_directory_exists(main->cache_argument);
-
- if (main->setting.state.status == F_false) {
- fake_build_print_error_exist_not_directory(&main->program.message, main->cache_argument);
-
- main->setting.state.status = F_status_set_error(F_failure);
-
- return 0;
- }
-
- if (main->setting.state.status == F_file_found_not) {
- main->setting.state.status = f_directory_create(main->cache_argument, mode.directory);
-
- if (F_status_is_error(main->setting.state.status)) {
- if (F_status_set_fine(main->setting.state.status) == F_file_found_not) {
- fake_build_print_error_cannot_create_due_to_parent(&main->program.message, main->cache_argument);
- }
- else {
- fake_print_error_file(&main->program.error, macro_fake_f(f_directory_create), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
- }
-
- return 0;
- }
-
- fake_build_print_verbose_create_directory(&main->program.message, main->cache_argument);
- }
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error_file(&main->program.error, macro_fake_f(f_directory_exists), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
-
- return 0;
- }
-
- if (F_status_is_error_not(main->setting.state.status)) {
- main->setting.state.status = f_string_dynamic_append_nulless(main->cache_1, &main->cache_argument);
- }
-
- if (F_status_is_error_not(main->setting.state.status)) {
- main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument);
- }
-
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless));
- return 0;
- }
-
- {
- const f_string_static_t values[] = {
- fake_build_parameter_object_compile_s,
- fake_build_parameter_object_output_s,
- main->cache_argument,
- };
-
- for (uint8_t i = 0; i < 3; ++i) {
-
- if (!values[i].used) continue;
-
- main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments);
- if (F_status_is_error(main->setting.state.status)) break;
- } // for
- }
-
- // The cache_argument should be safe at this point to be reset and reused by this function.
- fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(fake_build_arguments_standard_add));
-
- return 0;
- }
-
- result = fake_execute(data, data_build->environment, data_build->setting.build_compiler);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(fake_execute));
-
- return result;
- }
-
- if (result && !result_final) {
- result_final = result;
- }
- } // for
- } // for
-
- if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) {
- fake_build_touch(data, file_stage);
- }
-
- return result;
- }
-#endif // _di_fake_build_object_shared_
-
-#ifndef _di_fake_build_object_static_
- int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
-
- if (!data || !data->main || !data_build) return 0;
- if (data->main->setting.state.status == F_child) return data->main->program.child;
- if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
- if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0;
-
- fake_main_t * const main = data->main;
-
- int result = 0;
- int result_final = 0;
-
- f_number_unsigned_t i = 0;
- f_number_unsigned_t j = 0;
-
- const f_string_dynamics_t *sources[2] = {
- &data_build->setting.build_sources_object,
- &data_build->setting.build_sources_object_static,
- };
-
- fake_build_print_compile_object_static(&main->program.message);
-
- for (i = 0; i < 2; ++i) {
-
- for (j = 0; j < sources[i]->used; ++j) {
-
- fake_string_dynamic_reset(&main->cache_argument);
- fake_string_dynamics_reset(&main->cache_arguments);
-
- fake_build_sources_object_add(data, data_build, &sources[i]->array[j]);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(fake_build_sources_object_add));
-
- return 0;
- }
-
- fake_string_dynamic_reset(&main->cache_argument);
- fake_string_dynamic_reset(&main->cache_1);
- fake_string_dynamic_reset(&main->cache_2);
-
- fake_build_get_file_name_without_extension(data, sources[i]->array[j], &main->cache_1);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(fake_build_get_file_name_without_extension));
-
- return 0;
- }
-
- main->setting.state.status = f_file_name_directory(sources[i]->array[j], &main->cache_2);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory));
-
- return 0;
- }
-
- main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_2);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure));
-
- return 0;
- }
-
- main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_static, &main->cache_argument);
-
- if (F_status_is_error_not(main->setting.state.status)) {
- main->setting.state.status = f_string_dynamic_append_nulless(main->cache_2, &main->cache_argument);
+ break;
}
main->setting.state.status = f_directory_exists(main->cache_argument);
main->setting.state.status = F_status_set_error(F_failure);
- return 0;
+ break;
}
if (main->setting.state.status == F_file_found_not) {
fake_print_error_file(&main->program.error, macro_fake_f(f_directory_create), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
}
- return 0;
+ break;
}
fake_build_print_verbose_create_directory(&main->program.message, main->cache_argument);
}
-
- if (F_status_is_error(main->setting.state.status)) {
+ else if (F_status_is_error(main->setting.state.status)) {
fake_print_error_file(&main->program.error, macro_fake_f(f_directory_exists), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
- return 0;
+ break;
}
if (F_status_is_error_not(main->setting.state.status)) {
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless));
- return 0;
+ break;
}
{
const f_string_static_t values[] = {
+ shared ? f_string_empty_s : fake_build_parameter_library_static_s,
fake_build_parameter_object_compile_s,
fake_build_parameter_object_output_s,
main->cache_argument,
};
- for (uint8_t i = 0; i < 3; ++i) {
+ for (uint8_t i = 0; i < 4; ++i) {
if (!values[i].used) continue;
main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments);
if (F_status_is_error(main->setting.state.status)) break;
} // for
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add));
+
+ break;
+ }
}
// The cache_argument should be safe at this point to be reset and reused by this function.
- fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e);
+ fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e);
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(fake_build_arguments_standard_add));
- return 0;
+ break;
}
result = fake_execute(data, data_build->environment, data_build->setting.build_compiler);
if (F_status_is_error(main->setting.state.status)) {
fake_print_error(&main->program.error, macro_fake_f(fake_execute));
- return result;
+ result_final = result;
+
+ break;
}
if (result && !result_final) {
return result_final;
}
-#endif // _di_fake_build_object_static_
+#endif // _di_fake_build_object_
#ifdef __cplusplus
} // extern "C"
#endif // _di_fake_build_object_script_
/**
- * Build the shared objects.
+ * Build the shared or static objects.
*
* Object files can be compiled differently between shared and static such that a shared object might be compiled with -fPIC and a static object might not be.
- * This represents an object being compiled with the intent to be used in a shared library or program.
- *
- * @param data
- * The program data.
- *
- * This modifies data.main.cache_argument.
- * This modifies data.main.cache_arguments.
- *
- * This alters data.main->setting.state.status:
- * F_okay on success.
- *
- * Errors (with error bit) from: fll_execute_arguments_add().
- *
- * Errors (with error bit) from: fake_build_arguments_standard_add().
- * Errors (with error bit) from: fake_build_sources_object_add().
- * @param data_build
- * The build data.
- * @param mode
- * The file mode.
- * @param file_stage
- * The specific stage file path.
- *
- * @return
- * The return code of the execution process.
- * This generally is only needed when F_child is returned, where this holds the return status of the child process.
- *
- * @see fll_execute_arguments_add()
- *
- * @see fake_build_arguments_standard_add()
- * @see fake_build_sources_object_add()
- */
-#ifndef _di_fake_build_object_shared_
- extern int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage);
-#endif // _di_fake_build_object_shared_
-
-/**
- * Build the static objects.
- *
- * Object files can be compiled differently between shared and static such that a shared object might be compiled with -fPIC and a static object might not be.
- * This represents an object being compiled with the intent to be used in a static library or program.
+ * This represents an object being compiled with the intent to be used in a library or program.
*
* @param data
* The program data.
* The file mode.
* @param file_stage
* The specific stage file path.
+ * @param shared
+ * If F_true, then build a shared object.
+ * Otherwise, build a static object.
*
* @return
* The return code of the execution process.
* @see fake_build_sources_object_add()
* @see fake_execute()
*/
-#ifndef _di_fake_build_object_static_
- extern int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage);
-#endif // _di_fake_build_object_static_
+#ifndef _di_fake_build_object_
+ extern int fake_build_object(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, const uint8_t shared);
+#endif // _di_fake_build_object_
#ifdef __cplusplus
} // extern "C"
+++ /dev/null
-#include "../fake.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _di_fake_build_objects_static_
- int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
-
- if (!data || !data->main) return 0;
- if (data->main->setting.state.status == F_child) return data->main->program.child;
- if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
- if (!data_build->setting.build_sources_library.used) return 0;
-
- fake_main_t * const main = data->main;
-
- fake_build_print_compile_object_static_library(&main->program.message);
-
- fake_string_dynamics_reset(&main->cache_arguments);
-
- fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(fake_build_objects_add));
-
- return 0;
- }
-
- int result = main->program.child;
-
- const f_string_dynamics_t *sources[2] = {
- &data_build->setting.build_sources_library,
- &data_build->setting.build_sources_library_static,
- };
-
- f_number_unsigned_t i = 0;
- f_number_unsigned_t j = 0;
- uint8_t k = 0;
-
- for (i = 0; i < 2; ++i) {
-
- for (j = 0; j < sources[i]->used; ++j) {
-
- if (!sources[i]->array[j].used) continue;
-
- fake_string_dynamic_reset(&main->cache_1);
- fake_string_dynamic_reset(&main->cache_2);
- fake_string_dynamic_reset(&main->cache_argument);
-
- fake_build_path_source_string(data, data_build, &data_build->setting.path_sources_library, &main->cache_1);
- if (F_status_is_error(main->setting.state.status)) break;
-
- main->setting.state.status = f_string_dynamic_append_nulless(sources[i]->array[j], &main->cache_1);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless));
-
- return 0;
- }
-
- fake_build_get_file_name_without_extension(data, sources[i]->array[j], &main->cache_2);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(fake_build_get_file_name_without_extension));
-
- break;
- }
-
- main->setting.state.status = f_file_name_directory(sources[i]->array[j], &main->cache_argument);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory));
-
- break;
- }
-
- if (main->cache_argument.used) {
- main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects, &main->cache_argument);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_prepend));
-
- break;
- }
-
- main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_argument);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure));
-
- break;
- }
-
- main->setting.state.status = f_directory_exists(main->cache_argument);
-
- if (main->setting.state.status == F_false) {
- fake_build_print_error_exist_not_directory(&main->program.message, main->cache_argument);
-
- main->setting.state.status = F_status_set_error(F_failure);
-
- break;
- }
-
- if (main->setting.state.status == F_file_found_not) {
- main->setting.state.status = f_directory_create(main->cache_argument, mode.directory);
-
- if (F_status_is_error(main->setting.state.status)) {
- if (F_status_set_fine(main->setting.state.status) == F_file_found_not) {
- fake_build_print_error_cannot_create_due_to_parent(&main->program.message, main->cache_argument);
- }
- else {
- fake_print_error_file(&main->program.error, macro_fake_f(f_directory_create), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
- }
-
- break;
- }
-
- fake_build_print_verbose_create_directory(&main->program.message, main->cache_argument);
- }
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error_file(&main->program.error, macro_fake_f(f_directory_exists), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e);
-
- break;
- }
- }
-
- if (main->cache_argument.used) {
- main->setting.state.status = F_okay;
- }
- else {
- main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects, &main->cache_argument);
- }
-
- if (F_status_is_error_not(main->setting.state.status)) {
- main->setting.state.status = f_string_dynamic_append_nulless(main->cache_2, &main->cache_argument);
- }
-
- if (F_status_is_error_not(main->setting.state.status)) {
- main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument);
- }
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless));
-
- return 0;
- }
-
- const f_string_static_t values[] = {
- main->cache_1,
- fake_build_parameter_object_compile_s,
- fake_build_parameter_object_static_s,
- fake_build_parameter_object_output_s,
- main->cache_argument,
- };
-
- for (k = 0; k < 5; ++k) {
-
- if (!values[k].used) continue;
-
- main->setting.state.status = fll_execute_arguments_add(values[k], &main->cache_arguments);
- if (F_status_is_error(main->setting.state.status)) break;
- } // for
-
- // The cache_argument should be safe at this point to be reset and reused by this function.
- fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_library_e);
-
- if (F_status_is_error(main->setting.state.status)) {
- fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add));
-
- break;
- }
-
- result = fake_execute(data, data_build->environment, data_build->setting.build_compiler);
-
- if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) break;
- } // for
-
- if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) break;
- } // for
-
- if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) {
- fake_build_touch(data, file_stage);
- }
-
- return result;
- }
-#endif // _di_fake_build_objects_static_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: Featureless Make
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Provides build objects functionality.
- *
- * This is auto-included and should not need to be explicitly included.
- */
-#ifndef _fake_build_objects_h
-#define _fake_build_objects_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Build static objects that are needed when building a static library.
- *
- * This is neither the "build_sources_object" nor the "build_sources_object_static" property.
- * Instead, this converts the "build_sources_library" and the "build_sources_library_static" into a static object file so that the indexer program (such as GNU ar) can combine these into a static file.
- *
- * @param data
- * The program data.
- *
- * This modifies data.main.cache_1.
- * This modifies data.main.cache_2.
- * This modifies data.main.cache_argument.
- * This modifies data.main.cache_arguments.
- *
- * This alters data.main->settings.state.status:
- * F_okay on success.
- *
- * Errors (with error bit) from: f_directory_create().
- * Errors (with error bit) from: f_directory_exists().
- * Errors (with error bit) from: f_file_name_directory().
- * Errors (with error bit) from: f_string_dynamic_append_assure().
- * Errors (with error bit) from: f_string_dynamic_prepend().
- * Errors (with error bit) from: fll_execute_arguments_add().
- *
- * Errors (with error bit) from: fake_build_arguments_standard_add().
- * Errors (with error bit) from: fake_build_get_file_name_without_extension().
- * Errors (with error bit) from: fake_build_objects_add().
- * Errors (with error bit) from: fake_execute().
- * @param data_build
- * The build data.
- * @param mode
- * The file mode.
- * @param file_stage
- * The specific stage file path.
- *
- * @return
- * The return code of the execution process.
- * This generally is only needed when F_child is returned, where this holds the return status of the child process.
- *
- * @see f_directory_create()
- * @see f_directory_exists()
- * @see f_file_name_directory()
- * @see f_string_dynamic_append_assure()
- * @see f_string_dynamic_prepend()
- * @see fll_execute_arguments_add()
- *
- * @see fake_build_arguments_standard_add()
- * @see fake_build_get_file_name_without_extension()
- * @see fake_build_objects_add()
- * @see fake_execute()
- */
-#ifndef _di_fake_build_objects_static_
- extern int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage);
-#endif // _di_fake_build_objects_static_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _fake_build_objects_h
}
#endif // _di_fake_build_print_compile_library_static_
+#ifndef _di_fake_build_print_compile_library_static_object_
+ f_status_t fake_build_print_compile_library_static_object(fl_print_t * const print) {
+
+ if (!print) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_normal_e) return F_output_not;
+
+ fll_print_dynamic_raw(f_string_eol_s, print->to);
+ fake_print_context_important_simple(print, "Compiling static library object");
+
+ return F_okay;
+ }
+#endif // _di_fake_build_print_compile_library_static_object_
+
#ifndef _di_fake_build_print_compile_object_shared_
f_status_t fake_build_print_compile_object_shared(fl_print_t * const print) {
}
#endif // _di_fake_build_print_compile_program_static_
+#ifndef _di_fake_build_print_compile_program_static_object_
+ f_status_t fake_build_print_compile_program_static_object(fl_print_t * const print) {
+
+ if (!print) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_normal_e) return F_output_not;
+
+ fll_print_dynamic_raw(f_string_eol_s, print->to);
+ fake_print_context_important_simple(print, "Compiling static program object");
+
+ return F_okay;
+ }
+#endif // _di_fake_build_print_compile_program_static_object_
+
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_fake_build_print_compile_library_static_
/**
+ * Print message when compiling a static library objects.
+ *
+ * @param print
+ * The output structure to print to.
+ *
+ * This requires print.custom to be fake_main_t.
+ *
+ * This does not alter print.custom.setting.state.status.
+ *
+ * @return
+ * F_okay on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fake_print_context_important_simple()
+ */
+#ifndef _di_fake_build_print_compile_library_static_object_
+ extern f_status_t fake_build_print_compile_library_static_object(fl_print_t * const print);
+#endif // _di_fake_build_print_compile_library_static_object_
+
+/**
* Print message when compiling a shared object.
*
* @param print
extern f_status_t fake_build_print_compile_program_static(fl_print_t * const print);
#endif // _di_fake_build_print_compile_program_static_
+/**
+ * Print message when compiling a static program objects.
+ *
+ * @param print
+ * The output structure to print to.
+ *
+ * This requires print.custom to be fake_main_t.
+ *
+ * This does not alter print.custom.setting.state.status.
+ *
+ * @return
+ * F_okay on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fake_print_context_important_simple()
+ */
+#ifndef _di_fake_build_print_compile_program_static_object_
+ extern f_status_t fake_build_print_compile_program_static_object(fl_print_t * const print);
+#endif // _di_fake_build_print_compile_program_static_object_
+
#ifdef __cplusplus
} // extern "C"
#endif
if (F_status_is_error_not(main->setting.state.status)) {
// Only include the library if there are sources that would result in it being built.
- if (data_build->setting.build_sources_library.used) {
+ if (data_build->setting.build_sources_library.used || data_build->setting.build_sources_library_static.used) {
fake_string_dynamic_reset(&main->cache_argument);
- main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_name_prefix_s, &main->cache_argument);
+ main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_libraries_static, &main->cache_argument);
if (F_status_is_error_not(main->setting.state.status)) {
main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_name_prefix_s, &main->cache_argument);
const f_string_static_t fake_build_stage_library_script_s = macro_f_string_static_t_initialize_1(FAKE_build_stage_library_script_s, 0, FAKE_build_stage_library_script_s_length);
const f_string_static_t fake_build_stage_library_shared_s = macro_f_string_static_t_initialize_1(FAKE_build_stage_library_shared_s, 0, FAKE_build_stage_library_shared_s_length);
const f_string_static_t fake_build_stage_library_static_s = macro_f_string_static_t_initialize_1(FAKE_build_stage_library_static_s, 0, FAKE_build_stage_library_static_s_length);
+ const f_string_static_t fake_build_stage_library_static_object_s = macro_f_string_static_t_initialize_1(FAKE_build_stage_library_static_object_s, 0, FAKE_build_stage_library_static_object_s_length);
const f_string_static_t fake_build_stage_object_script_s = macro_f_string_static_t_initialize_1(FAKE_build_stage_object_script_s, 0, FAKE_build_stage_object_script_s_length);
const f_string_static_t fake_build_stage_object_shared_s = macro_f_string_static_t_initialize_1(FAKE_build_stage_object_shared_s, 0, FAKE_build_stage_object_shared_s_length);
const f_string_static_t fake_build_stage_object_static_s = macro_f_string_static_t_initialize_1(FAKE_build_stage_object_static_s, 0, FAKE_build_stage_object_static_s_length);
#define FAKE_build_stage_library_script_s "library_script"
#define FAKE_build_stage_library_shared_s "library_shared"
#define FAKE_build_stage_library_static_s "library_static"
+ #define FAKE_build_stage_library_static_object_s "library_static_object"
#define FAKE_build_stage_object_script_s "object_script"
#define FAKE_build_stage_object_shared_s "object_shared"
#define FAKE_build_stage_object_static_s "object_static"
#define FAKE_build_stage_program_script_s "program_script"
#define FAKE_build_stage_program_shared_s "program_shared"
#define FAKE_build_stage_program_static_s "program_static"
+ #define FAKE_build_stage_program_static_object_s "program_static_object"
#define FAKE_build_stage_separate_s "-"
#define FAKE_build_stage_skeleton_s "skeleton"
#define FAKE_build_stage_sources_documentation_s "sources_documentation"
#define FAKE_build_stage_library_script_s_length 14
#define FAKE_build_stage_library_shared_s_length 14
#define FAKE_build_stage_library_static_s_length 14
+ #define FAKE_build_stage_library_static_object_s_length 21
#define FAKE_build_stage_object_script_s_length 13
#define FAKE_build_stage_object_shared_s_length 13
#define FAKE_build_stage_object_static_s_length 13
#define FAKE_build_stage_program_script_s_length 14
#define FAKE_build_stage_program_shared_s_length 14
#define FAKE_build_stage_program_static_s_length 14
+ #define FAKE_build_stage_program_static_object_s_length 21
#define FAKE_build_stage_separate_s_length 1
#define FAKE_build_stage_skeleton_s_length 8
#define FAKE_build_stage_sources_documentation_s_length 21
extern const f_string_static_t fake_build_stage_library_script_s;
extern const f_string_static_t fake_build_stage_library_shared_s;
extern const f_string_static_t fake_build_stage_library_static_s;
+ extern const f_string_static_t fake_build_stage_library_static_object_s;
extern const f_string_static_t fake_build_stage_object_script_s;
extern const f_string_static_t fake_build_stage_object_shared_s;
extern const f_string_static_t fake_build_stage_object_static_s;
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_script.string, &build_stage->file_library_script.used, &build_stage->file_library_script.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_shared.string, &build_stage->file_library_shared.used, &build_stage->file_library_shared.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_static.string, &build_stage->file_library_static.used, &build_stage->file_library_static.size);
+ f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_library_static_object.string, &build_stage->file_library_static_object.used, &build_stage->file_library_static_object.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_script.string, &build_stage->file_object_script.used, &build_stage->file_object_script.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_shared.string, &build_stage->file_object_shared.used, &build_stage->file_object_shared.size);
f_memory_array_resize(0, sizeof(f_char_t), (void **) &build_stage->file_object_static.string, &build_stage->file_object_static.used, &build_stage->file_object_static.size);
* - file_library_script: The script library files.
* - file_library_shared: The shared library files.
* - file_library_static: The static library files.
+ * - file_library_static_object: The static library object files.
* - file_object_script: The script object files.
* - file_object_shared: The shared object files.
* - file_object_static: The static object files.
f_string_dynamic_t file_library_script;
f_string_dynamic_t file_library_shared;
f_string_dynamic_t file_library_static;
+ f_string_dynamic_t file_library_static_object;
f_string_dynamic_t file_object_script;
f_string_dynamic_t file_object_shared;
f_string_dynamic_t file_object_static;
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
}
- #define fake_build_stage_total_d 17
+ #define fake_build_stage_total_d 18
#endif // _di_fake_build_stage_t_
/**
#include <program/fake/main/build/library.h>
#include <program/fake/main/build/load.h>
#include <program/fake/main/build/object.h>
-#include <program/fake/main/build/objects.h>
#include <program/fake/main/build/print/compile.h>
#include <program/fake/main/build/print/error.h>
#include <program/fake/main/build/print/message.h>
build_libraries-monolithic -lfll
build_sources_library main/build.c main/clean.c main/common.c main/fake.c main/make.c main/print/common.c main/print/context.c main/print/error.c main/print/message.c main/print/operation.c main/print/warning.c main/print/verbose.c main/signal.c main/skeleton.c main/thread.c
-build_sources_library main/build/enumeration.c main/build/library.c main/build/load.c main/build/object.c main/build/objects.c main/build/print/compile.c main/build/print/error.c main/build/print/message.c main/build/print/verbose.c main/build/print/warning.c main/build/program.c main/build/skeleton.c main/build/string.c
+build_sources_library main/build/enumeration.c main/build/library.c main/build/load.c main/build/object.c main/build/print/compile.c main/build/print/error.c main/build/print/message.c main/build/print/verbose.c main/build/print/warning.c main/build/program.c main/build/skeleton.c main/build/string.c
build_sources_library main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c
build_sources_library main/fake/path_generate.c main/fake/do.c
build_sources_library main/make/load_fakefile.c main/make/load_parameters.c main/make/operate_block.c main/make/operate.c main/make/operate_process.c main/make/operate_process_type.c main/make/operate_validate.c main/make/operate_validate_type.c main/make/print/error.c main/make/print/message.c main/make/print/verbose.c main/make/print/warning.c
build_sources_program main/main.c
build_sources_headers main/build.h main/clean.h main/common.h main/fake.h main/make.h main/print/common.h main/print/context.h main/print/error.h main/print/message.h main/print/operation.h main/print/warning.h main/print/verbose.h main/signal.h main/skeleton.h main/thread.h
-build_sources_headers main/build/enumeration.h main/build/library.h main/build/load.h main/build/object.h main/build/objects.h main/build/print/compile.h main/build/print/error.h main/build/print/message.h main/build/print/verbose.h main/build/print/warning.h main/build/program.h main/build/skeleton.h main/build/string.h
+build_sources_headers main/build/enumeration.h main/build/library.h main/build/load.h main/build/object.h main/build/print/compile.h main/build/print/error.h main/build/print/message.h main/build/print/verbose.h main/build/print/warning.h main/build/program.h main/build/skeleton.h main/build/string.h
build_sources_headers main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h
build_sources_headers main/fake/path_generate.h main/fake/do.h
build_sources_headers main/make/load_fakefile.h main/make/load_parameters.h main/make/operate_block.h main/make/operate.h main/make/operate_process.h main/make/operate_process_type.h main/make/operate_validate.h main/make/operate_validate_type.h main/make/print/error.h main/make/print/message.h main/make/print/verbose.h main/make/print/warning.h
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, GNU LGPL Version 2.1 or later.
+Copyright \(co 2007-2024 Kevin Day, GNU LGPL Version 2.1 or later.
-.TH fake-defines "5" "March 2023" "FLL - Featureless Make 0.7.0" "File Formats"
+.TH fake-defines "5" "March 2024" "FLL - Featureless Make 0.7.0" "File Formats"
.SH NAME
Featureless Make \- "defines" file.
.SH SYNOPSIS
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
-.TH fake-dependencies "5" "March 2023" "FLL - Featureless Make 0.7.0" "File Formats"
+.TH fake-dependencies "5" "March 2024" "FLL - Featureless Make 0.7.0" "File Formats"
.SH NAME
Featureless Make \- "dependencies" file.
.SH SYNOPSIS
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
-.TH fake-fakefile "5" "March 2023" "FLL - Featureless Make 0.7.0" "File Formats"
+.TH fake-fakefile "5" "March 2024" "FLL - Featureless Make 0.7.0" "File Formats"
.SH NAME
Featureless Make \- "fakefile" file.
.SH SYNOPSIS
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
-.TH fake-settings "5" "March 202" "FLL - Featureless Make 0.7.0" "File Formats"
+.TH fake-settings "5" "March 2024" "FLL - Featureless Make 0.7.0" "File Formats"
.SH NAME
Featureless Make \- "settings" file.
.SH SYNOPSIS
The built object does not get linked and therefore no linker arguments apply.
The built object file is named using the \fBbuild_name\fR with the \fB.o\fR extension added.
May include a relative sub\-path to each individual source file (such as: \fBlevel_0/a.c\fR).
+ A collection of source files used for generating an object file with the same name as each source file.
+ The source files are located within the path designated by code:"path_sources_object".
+ The built objects do not get linked and therefore no linker arguments apply.
+ The built object files are named using the same name as the file with the file extension changed to the code:".o" extension.
+ May include a relative sub-path to each individual source file (such as: code:"level_0/a.c level_0/b.c").
+ This is different from code:"build_sources_object" in that multiple files are supported and multiple object files are created.
+
\- \fBbuild_sources_object_shared\fR:
A single source file used for generating an object file.
May include a relative sub\-path to each individual source file (such as: \fBlevel_0/a.c\fR).
These are applied to only shared builds.
+ A collection of source files used for generating an object file with the same name as each source file.
+ The source files are located within the path designated by code:"path_sources_object".
+ The built objects do not get linked and therefore no linker arguments apply.
+ The built object files are named using the same name as the file with the file extension changed to the code:".o" extension.
+ May include a relative sub-path to each individual source file (such as: code:"level_0/a.c level_0/b.c").
+ This is different from code:"build_sources_object" in that multiple files are supported and multiple object files are created.
+ These are applied to only shared builds.
+
\- \fBbuild_sources_object_static\fR:
A single source file used for generating an object file.
The source file is located within the path designated by \fBpath_sources_object\fR.
May include a relative sub\-path to each individual source file (such as: \fBlevel_0/a.c\fR).
These are applied to only static builds.
+ A collection of source files used for generating an object file with the same name as each source file.
+ The source files are located within the path designated by code:"path_sources_object".
+ The built objects do not get linked and therefore no linker arguments apply.
+ The built object files are named using the same name as the file with the file extension changed to the code:".o" extension.
+ May include a relative sub-path to each individual source file (such as: code:"level_0/a.c level_0/b.c").
+ This is different from code:"build_sources_object" in that multiple files are supported and multiple object files are created.
+ These are applied to only static builds.
+
\- \fBbuild_sources_objects\fR\:
A collection of source files used for generating an object file with the same name as each source file.
The source files are located within the path designated by \fBpath_sources_objects\fR.
This defaults to \fBsources\fR.
+\- \fBpath_sources_library\fR:
+ A sub\-path representing where the library source files are found.
+ This is used by \fBbuild_sources_library\fR.
+
+ This defaults to \fBsources\fR.
+
\- \fBpath_sources_object\fR:
- A sub\-path representing where the object source files are found.
+ A sub\-path representing where the header source object files are found.
This is used by \fBbuild_sources_object\fR.
This defaults to \fBsources\fR.
Written by Kevin Day.
.SH COPYRIGHT
.PP
-Copyright \(co 2007-2023 Kevin Day, Open Standard License 1.0 or later.
+Copyright \(co 2007-2024 Kevin Day, Open Standard License 1.0 or later.
print
print "Simulating Failure Return:"
- # Trigger an error, if "exit" doesn't exist then this is an error but if it does then exit with value 1 to represent an error.
+ # Trigger an error, if "exit" doesn't exist then this is an error but if it does exist, then exit with value 1 to represent an error.
shell exit 1
print "Return code is 'parameter:"return"'."
# fss-0002 iki-0000
#
# license: open-standard-license-1.0
+# version 2024/03/23
#
# This file (assumed to be named defines.txt) can be more easily read using the following iki_read commands:
# iki_read defines.txt +Q -w -WW code '"' '"' bold '"' '"'
# fss-0002 iki-0000
#
# license: open-standard-license-1.0
+# version 2024/03/23
#
# This file (assumed to be named dependencies.txt) can be more easily read using the following iki_read commands:
# iki_read dependencies.txt +Q -w -r FLL FLL -WW code '"' '"' bold '"' '"'
# fss-0002 iki-0000
#
# license: open-standard-license-1.0
+# version 2024/03/23
#
# This file (assumed to be named fakefile.txt) can be more easily read using the following iki_read commands:
# iki_read fakefile.txt +Q -w -WW character "'" "'" code '"' '"'
# fss-0002 iki-0000
#
# license: open-standard-license-1.0
+# version 2024/03/23
#
# This file (assumed to be named settings.txt) can be more easily read using the following iki_read commands:
# iki_read settings.txt +Q -w -WW character "'" "'" code '"' '"'