create-this-bsp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. #
  3. # This script creates the ucosii_net_zipfs Board Support Package (BSP).
  4. BSP_TYPE=hal
  5. BSP_DIR=.
  6. SOPC_DIR=../../
  7. SOPC_FILE=../../nios2_uc.sopcinfo
  8. NIOS2_BSP_ARGS=""
  9. CPU_NAME=
  10. if [ -n "$CPU_NAME" ]; then
  11. NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS --cpu-name $CPU_NAME"
  12. fi
  13. # Don't run make if create-this-app script is called with --no-make arg
  14. SKIP_MAKE=
  15. while [ $# -gt 0 ]
  16. do
  17. case "$1" in
  18. --no-make)
  19. SKIP_MAKE=1
  20. ;;
  21. *)
  22. NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1"
  23. ;;
  24. esac
  25. shift
  26. done
  27. # Run nios2-bsp utility to create a hal BSP in this directory
  28. # for the system with a .sopc file in $SOPC_FILE.
  29. # Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist.
  30. if [ -z "$SOPC_FILE" ]; then
  31. echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path."
  32. cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS"
  33. else
  34. cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS"
  35. fi
  36. echo "create-this-bsp: Running \"$cmd\""
  37. $cmd || {
  38. echo "$cmd failed"
  39. exit 1
  40. }
  41. if [ -z "$SKIP_MAKE" ]; then
  42. echo "create-this-bsp: Running make"
  43. make
  44. fi