em.cleanup_src() added, required for modules which must be build in the src directory

This commit is contained in:
2014-04-27 10:45:45 +02:00
parent 344794aaba
commit 089d5af181
3 changed files with 23 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
#!/bin/bash
declare -rx SHLIBDIR=$( cd $(dirname "$BASH_SOURCE") && pwd )
@@ -138,10 +139,13 @@ declare -x DOCDIR=''
declare -x EM_FAMILY=''
declare -x EM_MODULENAME=''
declare -x CONFIG_DIR="${EM_BASEDIR}/config"
declare -x SCRIPTDIR="${EM_BASEDIR}/scripts"
declare -x EM_TMPDIR="${EM_BASEDIR}/tmp"
# these directories are module dependend
declare -x EM_SRCDIR=''
declare -x EM_BUILDDIR=''
declare -x CONFIG_DIR="${EM_BASEDIR}/config"
declare -x EM_BUILD_DEPENDENCIES
@@ -375,6 +379,18 @@ function _cleanup_build() {
);
}
function em.cleanup_src() {
(
[[ -d /${EM_SRCDIR} ]] || return 0
cd "/${EM_SRCDIR}";
if [[ $(pwd) != / ]]; then
echo "Cleaning up $(pwd)"
rm -rf *
fi
);
}
function em.make_all() {
_set_env
if [[ ! -d "${PREFIX}" ]] || [[ ${FORCE_REBUILD} ]]; then

View File

@@ -1,4 +1,7 @@
#!/bin/bash
#
# Lua cannot be build in a seperate directory!
#
source "$(dirname $0)/../lib/libem.bash"
@@ -12,9 +15,10 @@ function em.configure() {
function em.build() {
cd "${EM_SRCDIR}"
make
make -j ${JOBS}
}
em.add_to_family "core"
em.set_build_dependencies "${COMPILER}"
em.make_all
em.cleanup_src

View File

@@ -51,4 +51,4 @@ em.add_to_family "compiler"
em.set_runtime_dependencies "${COMPILER}"
em.set_build_dependencies "${COMPILER}"
em.make_all
em.cleanup_src