Skip to content

Commit

Permalink
Rename build dir to gen (#89)
Browse files Browse the repository at this point in the history
Closes #67
  • Loading branch information
Tombana authored Jul 23, 2020
1 parent e8913bd commit a87f51f
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions larq_compute_engine/micro/build_make/build_lcem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ done
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="${SCRIPT_DIR}/../../.."
TF_DIR="${ROOT_DIR}/third_party/tensorflow"
GEN_DIR=${TF_DIR}/tensorflow/lite/micro/tools/make/gen
TF_GEN_DIR=${TF_DIR}/tensorflow/lite/micro/tools/make/gen
GEN_DIR="${ROOT_DIR}/gen"

# Relative to TF_DIR
LCE_MAKEFILE="${ROOT_DIR}/larq_compute_engine/micro/build_make/Makefile"
Expand All @@ -92,12 +93,14 @@ if [ "$clean" == "1" ]; then
echo " --> clean"
make -C ${TF_DIR} -f ${LCE_MAKEFILE} clean
rm -rf ${TF_DIR}/larq_compute_engine
rm -rf ${ROOT_DIR}/build
rm -rf ${GEN_DIR}
fi

# This has to be done before we make the submodule dirty
LCE_TAG="$(cd ${ROOT_DIR} && git describe --dirty --tags)"
LCE_DATE="$(date)"

generate_benchmark_build_info() {
LCE_TAG="$(cd ${ROOT_DIR} && git describe --dirty --tags)"
LCE_DATE="$(date)"
echo "// This file was auto-generated by build_lcem.sh" > $1
echo "#define LCE_GIT_TAG \"${LCE_TAG}\"" >> $1
echo "#define LCE_BUILD_DATE \"${LCE_DATE}\"" >> $1
Expand Down Expand Up @@ -187,8 +190,8 @@ if [ "$projects" == "1" ]; then
generate_lce_benchmark_make_project

for PROJECT_NAME in hello_lce lce_benchmark; do
PROJECT_DIR=${GEN_DIR}/make_x86_64/prj/${PROJECT_NAME}/make/
BUILD_DIR=${ROOT_DIR}/build/${PROJECT_NAME}_x86_64_make
PROJECT_DIR=${TF_GEN_DIR}/make_x86_64/prj/${PROJECT_NAME}/make/
BUILD_DIR=${GEN_DIR}/${PROJECT_NAME}_x86_64_make

mkdir -p ${BUILD_DIR}
cp -r ${PROJECT_DIR}/* ${BUILD_DIR}
Expand All @@ -213,12 +216,12 @@ if [ "$arduino" == "1" ]; then
# Optional: replace `generate_hello_lce_arduino_library_zip` by `generate_arduino_zip`
# to include all the TFLM examples as well. (The build will be a lot slower).
# In that case, also change the location of the zip file:
# LIBRARY_ZIP=${GEN_DIR}/arduino_cortex-m4/prj/lce_micro.zip
# LIBRARY_ZIP=${TF_GEN_DIR}/arduino_cortex-m4/prj/lce_micro.zip

LIBRARY_ZIP=${GEN_DIR}/arduino_cortex-m4/prj/hello_lce/lce_micro.zip
LIBRARY_ZIP=${TF_GEN_DIR}/arduino_cortex-m4/prj/hello_lce/lce_micro.zip

mkdir -p ${ROOT_DIR}/build
cp ${LIBRARY_ZIP} ${ROOT_DIR}/build/lce_micro.zip
mkdir -p ${GEN_DIR}
cp ${LIBRARY_ZIP} ${GEN_DIR}/lce_micro.zip

echo "The Arduino library zip file can be found at: build/lce_micro.zip"
echo "To install it, use the library system in the Arduino IDE or unzip it to ~/Arduino/libraries/"
Expand All @@ -239,8 +242,8 @@ if [ "$stm_make" == "1" ]; then
generate_lce_test_toy_model_make_project \
generate_lce_benchmark_make_project
for PROJECT_NAME in hello_lce lce_benchmark; do
PROJECT_DIR=${GEN_DIR}/make_cortex-m4/prj/${PROJECT_NAME}/make/
BUILD_DIR=${ROOT_DIR}/build/${PROJECT_NAME}_stm32f${STM_VERSION}_make
PROJECT_DIR=${TF_GEN_DIR}/make_cortex-m4/prj/${PROJECT_NAME}/make/
BUILD_DIR=${GEN_DIR}/${PROJECT_NAME}_stm32f${STM_VERSION}_make

mkdir -p ${BUILD_DIR}
cp -r ${PROJECT_DIR}/* ${BUILD_DIR}
Expand All @@ -262,8 +265,8 @@ if [ "$stm_mbed" == "1" ]; then
generate_lce_benchmark_mbed_project

for PROJECT_NAME in hello_lce lce_benchmark; do
PROJECT_DIR=${GEN_DIR}/mbed_cortex-m4/prj/${PROJECT_NAME}/mbed/
BUILD_DIR=${ROOT_DIR}/build/${PROJECT_NAME}_stm_mbed
PROJECT_DIR=${TF_GEN_DIR}/mbed_cortex-m4/prj/${PROJECT_NAME}/mbed/
BUILD_DIR=${GEN_DIR}/${PROJECT_NAME}_stm_mbed

mkdir -p ${BUILD_DIR}
cp -r ${PROJECT_DIR}/* ${BUILD_DIR}
Expand Down

0 comments on commit a87f51f

Please sign in to comment.