@@ -26,8 +26,6 @@ ROOT_PATH := .
2626
2727OS ?=$(shell uname -s)
2828
29- PACKAGE_NAME := "CMSIS"
30-
3129# -----------------------------------------------------------------------------
3230# packaging specific
3331
@@ -40,14 +38,89 @@ endif
4038# end of packaging specific
4139# -----------------------------------------------------------------------------
4240
43- .PHONY : all clean cmsis5 print_info postpackaging
41+ .PHONY : all clean cmsis5 cmsis6 cmsis_dsp cmsis_nn print_info postpackaging
4442
4543# Arduino module packaging:
4644# - exclude version control system files, here git files and folders .git, .gitattributes and .gitignore
4745# - exclude 'extras' folder
48- all : cmsis5
46+ all : cmsis6 cmsis_dsp cmsis_nn
47+
48+ cmsis6 : PACKAGE_NAME := "CMSIS"
49+ cmsis6 : PACKAGE_FOLDER := CMSIS_6
50+ cmsis6 : PACKAGE_VERSION := $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git describe --tags | sed 's/^v//')
51+ cmsis6 : PACKAGE_DATE := $(firstword $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git log -1 --pretty=format:% ci) )
52+ cmsis6 : clean print_info
53+ @echo ----------------------------------------------------------
54+ @echo " Packaging module."
55+ @tar --mtime=' $(PACKAGE_DATE)' \
56+ --exclude=.github \
57+ --exclude=CMSIS/CoreValidation \
58+ --exclude=CMSIS/Documentation \
59+ --exclude=CMSIS/Driver \
60+ --exclude=.git \
61+ --exclude=.gitignore \
62+ --exclude=gen_pack.sh \
63+ --exclude=.devcontainer \
64+ --transform " s|CMSIS_6|CMSIS|" \
65+ -cjf " $( PACKAGE_NAME) -$( PACKAGE_VERSION) .tar.bz2" " $( PACKAGE_FOLDER) "
66+ $(MAKE ) PACKAGE_NAME=$(PACKAGE_NAME ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
67+ @echo ----------------------------------------------------------
4968
69+ cmsis_dsp : PACKAGE_NAME := "CMSIS_DSP"
70+ cmsis_dsp : PACKAGE_FOLDER := CMSIS-DSP
71+ cmsis_dsp : PACKAGE_VERSION := $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git describe --tags | sed 's/^v//')
72+ cmsis_dsp : PACKAGE_DATE := $(firstword $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git log -1 --pretty=format:% ci) )
73+ cmsis_dsp : clean print_info
74+ @echo ----------------------------------------------------------
75+ @echo " Packaging module."
76+ @tar --mtime=' $(PACKAGE_DATE)' \
77+ --exclude=.github \
78+ --exclude=cmsisdsp \
79+ --exclude=Documentation \
80+ --exclude=dsppp \
81+ --exclude=Examples \
82+ --exclude=PythonWrapper \
83+ --exclude=Scripts \
84+ --exclude=Testing \
85+ --exclude=.git \
86+ --exclude=.gitignore \
87+ --exclude=CMakeLists.txt \
88+ --exclude=gen_pack.sh \
89+ --exclude=MANIFEST.in \
90+ --exclude=pyproject.toml \
91+ --exclude=PythonWrapper_README.md \
92+ --exclude=setup.py \
93+ --exclude=vcpkg-configuration.json \
94+ --transform " s|CMSIS-DSP|CMSIS_DSP|" \
95+ -cjf " $( PACKAGE_NAME) -$( PACKAGE_VERSION) .tar.bz2" " $( PACKAGE_FOLDER) "
96+ $(MAKE ) PACKAGE_NAME=$(PACKAGE_NAME ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
97+ @echo ----------------------------------------------------------
98+
99+ cmsis_nn : PACKAGE_NAME := "CMSIS_NN"
100+ cmsis_nn : PACKAGE_FOLDER := CMSIS-NN
101+ cmsis_nn : PACKAGE_VERSION := $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git describe --tags | sed 's/^v//')
102+ cmsis_nn : PACKAGE_DATE := $(firstword $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git log -1 --pretty=format:% ci) )
103+ cmsis_nn : clean print_info
104+ @echo ----------------------------------------------------------
105+ @echo " Packaging module."
106+ @tar --mtime=' $(PACKAGE_DATE)' \
107+ --exclude=.github \
108+ --exclude=Documentation \
109+ --exclude=Examples \
110+ --exclude=Tests \
111+ --exclude=.git \
112+ --exclude=.clang-format \
113+ --exclude=.gitignore \
114+ --exclude=check_pdsc.sh \
115+ --exclude=check_version_and_date.sh \
116+ --exclude=CMakeLists.txt \
117+ --exclude=gen_pack.sh \
118+ --transform " s|CMSIS-NN|CMSIS_NN|" \
119+ -cjf " $( PACKAGE_NAME) -$( PACKAGE_VERSION) .tar.bz2" " $( PACKAGE_FOLDER) "
120+ $(MAKE ) PACKAGE_NAME=$(PACKAGE_NAME ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
121+ @echo ----------------------------------------------------------
50122
123+ cmsis5 : PACKAGE_NAME := "CMSIS"
51124cmsis5 : PACKAGE_FOLDER := CMSIS_5
52125cmsis5 : PACKAGE_VERSION := $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git describe --tags)
53126cmsis5 : PACKAGE_DATE := $(firstword $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git log -1 --pretty=format:% ci) )
@@ -102,13 +175,13 @@ cmsis5: clean print_info
102175 --exclude=* .scvd \
103176 --transform " s|CMSIS_5|CMSIS|" \
104177 -cjf " $( PACKAGE_NAME) -$( PACKAGE_VERSION) .tar.bz2" " $( PACKAGE_FOLDER) "
105- $(MAKE ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
178+ $(MAKE ) PACKAGE_NAME= $( PACKAGE_NAME ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
106179 @echo ----------------------------------------------------------
107180
108181clean :
109182 @echo ----------------------------------------------------------
110183 @echo Cleanup
111- -$(RM ) $( PACKAGE_NAME ) -* .tar.bz2 package_ $( PACKAGE_NAME ) _* .json test_package_ $( PACKAGE_NAME ) _* .json
184+ -$(RM ) CMSIS * -* .tar.bz2 package_CMSIS * _* .json test_package_CMSIS * _* .json
112185 @echo ----------------------------------------------------------
113186
114187print_info :
@@ -126,5 +199,5 @@ postpackaging:
126199 @echo " PACKAGE_CHKSUM = $( PACKAGE_CHKSUM) "
127200 @echo " PACKAGE_SIZE = $( PACKAGE_SIZE) "
128201 @echo " PACKAGE_FILENAME = $( PACKAGE_FILENAME) "
129- @cat extras/package_index.json.template | sed s/%%VERSION%%/$(PACKAGE_VERSION ) / | sed s/%%FILENAME%%/$(PACKAGE_FILENAME ) / | sed s/%%CHECKSUM%%/$(PACKAGE_CHKSUM ) / | sed s/%%SIZE%%/$(PACKAGE_SIZE ) / > package_$(PACKAGE_NAME ) _$(PACKAGE_VERSION ) _index.json
202+ @cat extras/package_index.json.template | sed s/%%PACKAGENAME%%/ $( PACKAGE_NAME ) / | sed s/%% VERSION%%/$(PACKAGE_VERSION ) / | sed s/%%FILENAME%%/$(PACKAGE_FILENAME ) / | sed s/%%CHECKSUM%%/$(PACKAGE_CHKSUM ) / | sed s/%%SIZE%%/$(PACKAGE_SIZE ) / > package_$(PACKAGE_NAME ) _$(PACKAGE_VERSION ) _index.json
130203 @echo " package_$( PACKAGE_NAME) _$( PACKAGE_VERSION) _index.json created"
0 commit comments