Commit e91c6d20 authored by Lucas Russo's avatar Lucas Russo

compile.sh: add "with_examples"" option to build examples

parent d879779e
#!/usr/bin/env bash
VALID_BOARDS_STR="Valid values are: \"ml605\" and \"afcv3\"."
VALID_WITH_EXAMPLES_STR="Valid values are: \"with_examples\" or \"without_examples\"."
#######################################
# All of our Makefile options
......@@ -19,6 +20,13 @@ if [ "$BOARD" != "afcv3" ] && [ "$BOARD" != "ml605" ]; then
exit 1
fi
WITH_EXAMPLES=$2
if [ -n "$WITH_EXAMPLES" ] && [ "$WITH_EXAMPLES" != "with_examples" ] && [ "$WITH_EXAMPLES" != "without_examples" ]; then
echo "Wrong variable value. "$VALID_WITH_EXAMPLES_STR
exit 1
fi
# Select if we want to have the AFCv3 DDR memory shrink to 2^28 or the full size 2^32. Options are: (y)es ot (n)o.
# This is a TEMPORARY fix until the AFCv3 FPGA firmware is fixed. If unsure, select (y)es.
SHRINK_AFCV3_DDR_SIZE=y
......@@ -76,10 +84,18 @@ COMMAND_LIBBPMCLIENT="\
LOCAL_MSG_DBG=${LOCAL_MSG_DBG} && \
sudo make libbpmclient_install"
if [ "$WITH_EXAMPLES" = "with_examples" ]; then
COMMAND_EXAMPLES="\
make examples"
else
COMMAND_EXAMPLES=""
fi
COMMAND_ARRAY=(
"${COMMAND_DEPS}"
"${COMMAND_HAL}"
"${COMMAND_LIBBPMCLIENT}"
"${COMMAND_EXAMPLES}"
)
for i in "${COMMAND_ARRAY[@]}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment