# # $Id: stages.in,v 1.18 2004/06/07 17:29:26 jmmv Exp $ # Standard stage definitions. # # buildtool # Copyright (c) 2003, 2004 Julio M. Merino Vidal. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # 3. Neither the name of the author nor the names of contributors may # be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # BT_STAGES="build clean cleandir deinstall install test" stage_build() { local res bt_run_hooks BT_PRE_BUILD res=1 while [ ${#} -gt 0 ]; do bt_do_target build no ${1} && res=0 shift done bt_run_hooks BT_POST_BUILD return ${res} } stage_clean() { bt_run_hooks BT_PRE_CLEAN while [ ${#} -gt 0 ]; do bt_do_target clean yes ${1} shift done bt_run_hooks BT_POST_CLEAN return 0 } stage_cleandir() { bt_run_hooks BT_PRE_CLEANDIR while [ ${#} -gt 0 ]; do bt_do_target clean yes ${1} bt_do_target cleandir yes ${1} rmdir ${BT_OBJDIR} 2>/dev/null shift done bt_run_hooks BT_POST_CLEANDIR rmdir ${BT_WORKDIR} 2>/dev/null return 0 } stage_deinstall() { bt_run_hooks BT_PRE_DEINSTALL while [ ${#} -gt 0 ]; do bt_do_target deinstall yes ${1} shift done bt_run_hooks BT_POST_DEINSTALL return 0 } stage_install() { bt_run_hooks BT_PRE_INSTALL while [ ${#} -gt 0 ]; do bt_do_target install yes ${1} shift done bt_run_hooks BT_POST_INSTALL return 0 } stage_test() { bt_run_hooks BT_PRE_TEST while [ ${#} -gt 0 ]; do bt_do_target test yes ${1} shift done bt_run_hooks BT_POST_TEST return 0 } # Local Variables: *** # mode: shell-script *** # End: *** # vim: syntax=sh