1
0

install_test.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. WOLFSSL_SRC_DIR=../../..
  3. if [ ! -d $WOLFSSL_SRC_DIR ]; then
  4. echo "Directory does not exist: $WOLFSSL_SRC_DIR"
  5. exit 1
  6. fi
  7. if [ ! -f $WOLFSSL_SRC_DIR/wolfcrypt/benchmark/benchmark.c ]; then
  8. echo "Missing source file: $WOLFSSL_SRC_DIR/wolfcrypt/benchmark/benchmark.h"
  9. exit 1
  10. fi
  11. ZEPHYR_DIR=
  12. if [ $# -ne 1 ]; then
  13. echo "Need location of zephyr project as a command line argument"
  14. exit 1
  15. else
  16. ZEPHYR_DIR=$1
  17. fi
  18. if [ ! -d $ZEPHR_DIR ]; then
  19. echo "Zephyr project directory does not exist: $ZEPHYR_DIR"
  20. exit 1
  21. fi
  22. ZEPHYR_SAMPLES_DIR=$ZEPHYR_DIR/zephyr/samples/modules
  23. if [ ! -d $ZEPHYR_SAMPLES_DIR ]; then
  24. echo "Zephyr samples/modules directory does not exist: $ZEPHYR_SAMPLES_DIR"
  25. exit 1
  26. fi
  27. ZEPHYR_WOLFSSL_DIR=$ZEPHYR_SAMPLES_DIR/wolfssl_benchmark
  28. echo "wolfSSL directory:"
  29. echo " $ZEPHYR_WOLFSSL_DIR"
  30. rm -rf $ZEPHYR_WOLFSSL_DIR
  31. mkdir $ZEPHYR_WOLFSSL_DIR
  32. echo "Copy in Build files ..."
  33. cp -r * $ZEPHYR_WOLFSSL_DIR/
  34. rm $ZEPHYR_WOLFSSL_DIR/$0
  35. echo "Copy Source Code ..."
  36. rm -rf $ZEPHYR_WOLFSSL_DIR/src
  37. mkdir $ZEPHYR_WOLFSSL_DIR/src
  38. cp -rf ${WOLFSSL_SRC_DIR}/wolfcrypt/benchmark/benchmark.c $ZEPHYR_WOLFSSL_DIR/src/
  39. cp -rf ${WOLFSSL_SRC_DIR}/wolfcrypt/benchmark/benchmark.h $ZEPHYR_WOLFSSL_DIR/src/
  40. echo "Done"