local sources=
local i=
- if [[ $shared == "yes" ]] ; then
+ if [[ $sources_headers != "" ]] ; then
+ for i in $sources_headers ; do
+ cp -vf sources/c/$i ${path_build}includes/level_$level/ || failure=1
+ done
+ fi
+
+ if [[ $failure == "" && $shared == "yes" ]] ; then
if [[ $sources_library != "" ]] ; then
for i in $sources_library ; do
sources="${sources}sources/c/$i "
echo $compiler $arguments ${variables[$(generate_id flags_shared)]} ${variables[$(generate_id flags_program)]} $sources -o ${path_build}programs/$name
$compiler $arguments ${variables[$(generate_id flags_shared)]} ${variables[$(generate_id flags_program)]} $sources -o ${path_build}programs/$name || failure=1
fi
- else
+ elif [[ $failure == "" ]] ; then
if [[ $sources_library != "" ]] ; then
for i in $sources_library ; do
sources="${sources}sources/c/$i "
fi
fi
- if [[ $failure == "" && $sources_headers != "" ]] ; then
- for i in $sources_headers ; do
- cp -vf sources/c/$i ${path_build}includes/level_$level/ || failure=1
- done
- fi
-
if [[ $failure != "" ]] ; then
echo -e "${c_error}ERROR: failed to build.$c_reset"
generate_cleanup