-fetch_submodules_cmd=''
-if ! [ -f "${project_source_dir}/libs/crunch/inc/crn_decomp.h" ]
-then
- fetch_submodules_cmd='git submodule update --init --recursive'
-fi
+task_enter_build_dir () {
+ sync
+ mkdir -pv "${build_dir}"
+ cd "${build_dir}"
+}
+
+task_fetch_submodules () {
+ sync
+ "${fetch_submodules_cmd[@]}"
+}
+
+task_configure () {
+ sync
+ cmake \
+ -G'Unix Makefiles' \
+ -D'CMAKE_INSTALL_PREFIX'="${install_dir}" \
+ -D'CMAKE_BUILD_TYPE'="${build_type}" \
+ "${cmake_user_opts[@]}" \
+ "${project_source_dir}"
+}
+
+task_build_builtins () {
+ sync
+ make -j"${job_count}" builtins
+}
+
+task_discover_builtins () {
+ sync
+ cmake "${project_source_dir}"
+}
+
+task_build () {
+ sync
+ make -j"${job_count}"
+}
+
+task_install () {
+ sync
+ make "${install_target}"
+}