@@ -24,13 +24,12 @@ SHELL = /bin/sh
2424
2525ROOT_PATH := .
2626
27- # PACKAGE_NAME := $(basename $(notdir $(CURDIR)))
27+ OS ?=$(shell uname -s)
28+
2829PACKAGE_NAME := "CMSIS"
29- PACKAGE_VERSION := 4.5.0
3030
3131# -----------------------------------------------------------------------------
3232# packaging specific
33- PACKAGE_FOLDER := CMSIS
3433
3534ifeq (postpackaging,$(findstring $(MAKECMDGOALS ) ,postpackaging) )
3635 PACKAGE_FILENAME =$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.bz2
@@ -41,12 +40,16 @@ endif
4140# end of packaging specific
4241# -----------------------------------------------------------------------------
4342
44- .PHONY : all clean print_info postpackaging
43+ .PHONY : all clean cmsis cmsis5 print_info postpackaging
4544
4645# Arduino module packaging:
4746# - exclude version control system files, here git files and folders .git, .gitattributes and .gitignore
4847# - exclude 'extras' folder
49- all : clean print_info
48+ all : cmsis cmsis5
49+
50+ cmsis : PACKAGE_VERSION := 4.5.0
51+ cmsis : PACKAGE_FOLDER := CMSIS
52+ cmsis : clean print_info
5053 @echo ----------------------------------------------------------
5154 @echo " Packaging module."
5255 tar --exclude=./.gitattributes \
@@ -59,7 +62,34 @@ all: clean print_info
5962 --exclude=Device/ARM/Documents \
6063 --exclude=.git \
6164 -cjf " $( PACKAGE_NAME) -$( PACKAGE_VERSION) .tar.bz2" " $( PACKAGE_FOLDER) "
62- $(MAKE ) --no-builtin-rules postpackaging -C .
65+ $(MAKE ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
66+ @echo ----------------------------------------------------------
67+
68+ cmsis5 : PACKAGE_VERSION := 5.3.0
69+ cmsis5 : PACKAGE_FOLDER := CMSIS_5
70+ cmsis5 : clean print_info
71+ @echo ----------------------------------------------------------
72+ @echo " Packaging module."
73+ tar --exclude=docs \
74+ --exclude=CMSIS/CoreValidation \
75+ --exclude=CMSIS/Documentation \
76+ --exclude=CMSIS/DoxyGen \
77+ --exclude=CMSIS/NN/Examples \
78+ --exclude=CMSIS/NN/NN_Lib_Tests \
79+ --exclude=CMSIS/Pack \
80+ --exclude=CMSIS/Utilities \
81+ --exclude=CMSIS/DSP/DSP_Lib_TestSuite \
82+ --exclude=CMSIS/DSP/Examples \
83+ --exclude=CMSIS/DSP/Projects \
84+ --exclude=Device/ARM/Documents \
85+ --exclude=.git \
86+ --exclude=.gitignore \
87+ --exclude=.gitattributes \
88+ --exclude=manifest \
89+ --exclude=* .pdf \
90+ --transform " s|CMSIS_5|CMSIS|" \
91+ -cjf " $( PACKAGE_NAME) -$( PACKAGE_VERSION) .tar.bz2" " $( PACKAGE_FOLDER) "
92+ $(MAKE ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
6393 @echo ----------------------------------------------------------
6494
6595clean :
@@ -74,8 +104,10 @@ print_info:
74104 @echo " CURDIR = $( CURDIR) "
75105 @echo " OS = $( OS) "
76106 @echo " SHELL = $( SHELL) "
77- @echo " PACKAGE_VERSION = $( PACKAGE_VERSION) "
78107 @echo " PACKAGE_NAME = $( PACKAGE_NAME) "
108+ @echo " PACKAGE_FOLDER = $( PACKAGE_FOLDER) "
109+ @echo " PACKAGE_VERSION = $( PACKAGE_VERSION) "
110+
79111
80112postpackaging :
81113 @echo " PACKAGE_CHKSUM = $( PACKAGE_CHKSUM) "
0 commit comments