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