Skip to content

Commit 30de4f8

Browse files
authored
Merge pull request #1 from stm32duino/CMSIS_5
Add CMSIS 5 support
2 parents 6ca58fa + 50d200d commit 30de4f8

File tree

4 files changed

+51
-10
lines changed

4 files changed

+51
-10
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.swp
2+
CMSIS-*.tar.bz2
3+
package_CMSIS_*_index.json

Diff for: .gitmodules

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "ARM_CMSIS"]
22
path = CMSIS
3-
url = [email protected]:ARM-software/CMSIS.git
3+
url = https://github.com/ARM-software/CMSIS.git
4+
[submodule "CMSIS_5"]
5+
path = CMSIS_5
6+
url = https://github.com/ARM-software/CMSIS_5.git

Diff for: CMSIS_5

Submodule CMSIS_5 added at 49ac527

Diff for: Makefile

+43-9
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ SHELL = /bin/sh
2424

2525
ROOT_PATH := .
2626

27-
#PACKAGE_NAME := $(basename $(notdir $(CURDIR)))
27+
OS ?=$(shell uname -s)
28+
2829
PACKAGE_NAME := "CMSIS"
29-
PACKAGE_VERSION := 4.5.0
3030

3131
# -----------------------------------------------------------------------------
3232
# packaging specific
33-
PACKAGE_FOLDER := CMSIS
3433

3534
ifeq (postpackaging,$(findstring $(MAKECMDGOALS),postpackaging))
3635
PACKAGE_FILENAME=$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2
@@ -41,15 +40,19 @@ 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."
52-
tar --exclude=./.gitattributes \
55+
@tar --exclude=./.gitattributes \
5356
--exclude=./.travis.yml \
5457
--exclude=CMSIS/index.html \
5558
--exclude=CMSIS/Documentation \
@@ -59,7 +62,36 @@ 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_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 .
6395
@echo ----------------------------------------------------------
6496

6597
clean:
@@ -74,12 +106,14 @@ print_info:
74106
@echo "CURDIR = $(CURDIR)"
75107
@echo "OS = $(OS)"
76108
@echo "SHELL = $(SHELL)"
77-
@echo "PACKAGE_VERSION = $(PACKAGE_VERSION)"
78109
@echo "PACKAGE_NAME = $(PACKAGE_NAME)"
110+
@echo "PACKAGE_FOLDER = $(PACKAGE_FOLDER)"
111+
@echo "PACKAGE_VERSION = $(PACKAGE_VERSION)"
112+
79113

80114
postpackaging:
81115
@echo "PACKAGE_CHKSUM = $(PACKAGE_CHKSUM)"
82116
@echo "PACKAGE_SIZE = $(PACKAGE_SIZE)"
83117
@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
85119
@echo "package_$(PACKAGE_NAME)_$(PACKAGE_VERSION)_index.json created"

0 commit comments

Comments
 (0)