From: Kevin Day Date: Wed, 7 Mar 2012 04:40:57 +0000 (-0600) Subject: Bugfix: build headers first X-Git-Tag: 0.3.x~3 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=22f549f082579ab81037f05581c4fc02e72fcc6d;p=fll Bugfix: build headers first It is entirely possible that building the headers first is the smarter thing to do. Afterall, the source files may in fact actually use the headers they provide. --- diff --git a/build/scripts/generate.sh b/build/scripts/generate.sh index d646bf4..3289ff3 100644 --- a/build/scripts/generate.sh +++ b/build/scripts/generate.sh @@ -236,7 +236,13 @@ generate_operation_build(){ 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 " @@ -260,7 +266,7 @@ generate_operation_build(){ 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 " @@ -281,12 +287,6 @@ generate_operation_build(){ 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