@@ -24,13 +24,12 @@ SHELL = /bin/sh
24
24
25
25
ROOT_PATH := .
26
26
27
- # PACKAGE_NAME := $(basename $(notdir $(CURDIR)))
27
+ OS ?=$(shell uname -s)
28
+
28
29
PACKAGE_NAME := "CMSIS"
29
- PACKAGE_VERSION := 4.5.0
30
30
31
31
# -----------------------------------------------------------------------------
32
32
# packaging specific
33
- PACKAGE_FOLDER := CMSIS
34
33
35
34
ifeq (postpackaging,$(findstring $(MAKECMDGOALS ) ,postpackaging) )
36
35
PACKAGE_FILENAME =$(PACKAGE_NAME ) -$(PACKAGE_VERSION ) .tar.bz2
@@ -41,15 +40,19 @@ endif
41
40
# end of packaging specific
42
41
# -----------------------------------------------------------------------------
43
42
44
- .PHONY : all clean print_info postpackaging
43
+ .PHONY : all clean cmsis cmsis5 print_info postpackaging
45
44
46
45
# Arduino module packaging:
47
46
# - exclude version control system files, here git files and folders .git, .gitattributes and .gitignore
48
47
# - 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
50
53
@echo ----------------------------------------------------------
51
54
@echo " Packaging module."
52
- tar --exclude=./.gitattributes \
55
+ @ tar --exclude=./.gitattributes \
53
56
--exclude=./.travis.yml \
54
57
--exclude=CMSIS/index.html \
55
58
--exclude=CMSIS/Documentation \
@@ -59,7 +62,36 @@ all: clean print_info
59
62
--exclude=Device/ARM/Documents \
60
63
--exclude=.git \
61
64
-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_FOLDER := CMSIS_5
69
+ cmsis5 : PACKAGE_VERSION := $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git describe --tags)
70
+ cmsis5 : PACKAGE_DATE := $(firstword $(shell git --git-dir=$(PACKAGE_FOLDER ) /.git log -1 --pretty=format:% ci) )
71
+ cmsis5 : clean print_info
72
+ @echo ----------------------------------------------------------
73
+ @echo " Packaging module."
74
+ @tar --mtime=' $(PACKAGE_DATE)' \
75
+ --exclude=docs \
76
+ --exclude=CMSIS/CoreValidation \
77
+ --exclude=CMSIS/Documentation \
78
+ --exclude=CMSIS/DoxyGen \
79
+ --exclude=CMSIS/NN/Examples \
80
+ --exclude=CMSIS/NN/NN_Lib_Tests \
81
+ --exclude=CMSIS/Pack \
82
+ --exclude=CMSIS/Utilities \
83
+ --exclude=CMSIS/DSP/DSP_Lib_TestSuite \
84
+ --exclude=CMSIS/DSP/Examples \
85
+ --exclude=CMSIS/DSP/Projects \
86
+ --exclude=Device/ARM/Documents \
87
+ --exclude=.git \
88
+ --exclude=.gitignore \
89
+ --exclude=.gitattributes \
90
+ --exclude=manifest \
91
+ --exclude=* .pdf \
92
+ --transform " s|CMSIS_5|CMSIS|" \
93
+ -cjf " $( PACKAGE_NAME) -$( PACKAGE_VERSION) .tar.bz2" " $( PACKAGE_FOLDER) "
94
+ $(MAKE ) PACKAGE_VERSION=$(PACKAGE_VERSION ) --no-builtin-rules postpackaging -C .
63
95
@echo ----------------------------------------------------------
64
96
65
97
clean :
@@ -74,12 +106,14 @@ print_info:
74
106
@echo " CURDIR = $( CURDIR) "
75
107
@echo " OS = $( OS) "
76
108
@echo " SHELL = $( SHELL) "
77
- @echo " PACKAGE_VERSION = $( PACKAGE_VERSION) "
78
109
@echo " PACKAGE_NAME = $( PACKAGE_NAME) "
110
+ @echo " PACKAGE_FOLDER = $( PACKAGE_FOLDER) "
111
+ @echo " PACKAGE_VERSION = $( PACKAGE_VERSION) "
112
+
79
113
80
114
postpackaging :
81
115
@echo " PACKAGE_CHKSUM = $( PACKAGE_CHKSUM) "
82
116
@echo " PACKAGE_SIZE = $( PACKAGE_SIZE) "
83
117
@echo " PACKAGE_FILENAME = $( PACKAGE_FILENAME) "
84
- 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
118
+ @ 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
85
119
@echo " package_$( PACKAGE_NAME) _$( PACKAGE_VERSION) _index.json created"
0 commit comments