build.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. set -e
  3. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  4. BASE_DIR="$( realpath "$DIR/../../../" )"
  5. echo "== freeRTOS Build =="
  6. # Add xtensa compiler to path
  7. export PATH=$PATH:$IDF_PATH/xtensa-esp32-elf/bin
  8. mkdir -p build_freertos && cd build_freertos
  9. CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug \
  10. -DUA_ENABLE_AMALGAMATION=OFF \
  11. -DCMAKE_TOOLCHAIN_FILE=${IDF_PATH}/tools/cmake/toolchain-esp32.cmake \
  12. -DUA_ARCHITECTURE=freertosLWIP \
  13. -DUA_BUILD_EXAMPLES=OFF"
  14. # We first need to call cmake separately to generate the required source code. Then we can call the freeRTOS CMake
  15. mkdir lib && cd lib
  16. cmake \
  17. ${CMAKE_ARGS} \
  18. ${BASE_DIR}
  19. if [ $? -ne 0 ] ; then exit 1 ; fi
  20. make -j open62541-code-generation
  21. if [ $? -ne 0 ] ; then exit 1 ; fi
  22. # Now call the freeRTOS CMake with same arguments
  23. cd ..
  24. cmake \
  25. ${CMAKE_ARGS} \
  26. ${BASE_DIR}/tools/azure-devops/freeRTOS/
  27. if [ $? -ne 0 ] ; then exit 1 ; fi
  28. # NOTE!!!
  29. # If you came here to see how to build your own version for the ESP32,
  30. # make sure to call `make menuconfig` first and configure the options.
  31. make hello-world.elf
  32. if [ $? -ne 0 ] ; then exit 1 ; fi