gen_pack.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #!/usr/bin/env bash
  2. # Version: 3.0
  3. # Date: 2023-11-06
  4. # This bash script generates a CMSIS-DSP Software Pack:
  5. #
  6. set -o pipefail
  7. # Set version of gen pack library
  8. # For available versions see https://github.com/Open-CMSIS-Pack/gen-pack/tags.
  9. # Use the tag name without the prefix "v", e.g., 0.7.0
  10. REQUIRED_GEN_PACK_LIB="0.9.1"
  11. # Set default command line arguments
  12. DEFAULT_ARGS=(-c "v")
  13. # Pack warehouse directory - destination
  14. # Default: ./output
  15. #
  16. # PACK_OUTPUT=./output
  17. # Temporary pack build directory,
  18. # Default: ./build
  19. #
  20. # PACK_BUILD=./build
  21. # Specify directory names to be added to pack base directory
  22. # An empty list defaults to all folders next to this script.
  23. # Default: empty (all folders)
  24. #
  25. PACK_DIRS="
  26. ComputeLibrary
  27. Documentation
  28. Examples
  29. Include
  30. PrivateInclude
  31. Source
  32. "
  33. # Specify file names to be added to pack base directory
  34. # Default: empty
  35. #
  36. PACK_BASE_FILES="
  37. LICENSE
  38. "
  39. # Specify file names to be deleted from pack build directory
  40. # Default: empty
  41. #
  42. PACK_DELETE_FILES="
  43. Documentation/Doxygen
  44. Documentation/README.md
  45. "
  46. # Specify patches to be applied
  47. # Default: empty
  48. #
  49. # PACK_PATCH_FILES=""
  50. # Specify addition argument to packchk
  51. # Default: empty
  52. #
  53. # PACKCHK_ARGS=()
  54. # Specify additional dependencies for packchk
  55. # Default: empty
  56. #
  57. PACKCHK_DEPS="
  58. ARM.CMSIS.pdsc
  59. "
  60. # Optional: restrict fallback modes for changelog generation
  61. # Default: full
  62. # Values:
  63. # - full Tag annotations, release descriptions, or commit messages (in order)
  64. # - release Tag annotations, or release descriptions (in order)
  65. # - tag Tag annotations only
  66. #
  67. PACK_CHANGELOG_MODE="tag"
  68. #
  69. # custom pre-processing steps
  70. #
  71. # usage: preprocess <build>
  72. # <build> The build folder
  73. #
  74. function preprocess() {
  75. # add custom steps here to be executed
  76. # before populating the pack build folder
  77. ./Documentation/Doxygen/gen_doc.sh
  78. return 0
  79. }
  80. #
  81. # custom post-processing steps
  82. #
  83. # usage: postprocess <build>
  84. # <build> The build folder
  85. #
  86. function postprocess() {
  87. # add custom steps here to be executed
  88. # after populating the pack build folder
  89. # but before archiving the pack into output folder
  90. return 0
  91. }
  92. ############ DO NOT EDIT BELOW ###########
  93. # Set GEN_PACK_LIB_PATH to use a specific gen-pack library root
  94. # ... instead of bootstrap based on REQUIRED_GEN_PACK_LIB
  95. if [[ -f "${GEN_PACK_LIB_PATH}/gen-pack" ]]; then
  96. . "${GEN_PACK_LIB}/gen-pack"
  97. else
  98. . <(curl -sL "https://raw.githubusercontent.com/Open-CMSIS-Pack/gen-pack/main/bootstrap")
  99. fi
  100. gen_pack "${DEFAULT_ARGS[@]}" "$@"
  101. exit 0