Skip to content

Commit

Permalink
Update Makefile to get CMSIS 5 version from git
Browse files Browse the repository at this point in the history
Use commit date to always generate the same package using tar.

Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Aug 14, 2018
1 parent ebf2061 commit 50d200d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cmsis: PACKAGE_FOLDER := CMSIS
cmsis: clean print_info
@echo ----------------------------------------------------------
@echo "Packaging module."
tar --exclude=./.gitattributes \
@tar --exclude=./.gitattributes \
--exclude=./.travis.yml \
--exclude=CMSIS/index.html \
--exclude=CMSIS/Documentation \
Expand All @@ -65,12 +65,14 @@ cmsis: clean print_info
$(MAKE) PACKAGE_VERSION=$(PACKAGE_VERSION) --no-builtin-rules postpackaging -C .
@echo ----------------------------------------------------------

cmsis5: PACKAGE_VERSION := 5.3.0
cmsis5: PACKAGE_FOLDER := CMSIS_5
cmsis5: PACKAGE_VERSION := $(shell git --git-dir=$(PACKAGE_FOLDER)/.git describe --tags)
cmsis5: PACKAGE_DATE := $(firstword $(shell git --git-dir=$(PACKAGE_FOLDER)/.git log -1 --pretty=format:%ci))
cmsis5: clean print_info
@echo ----------------------------------------------------------
@echo "Packaging module."
tar --exclude=docs \
@tar --mtime='$(PACKAGE_DATE)' \
--exclude=docs \
--exclude=CMSIS/CoreValidation \
--exclude=CMSIS/Documentation \
--exclude=CMSIS/DoxyGen \
Expand Down Expand Up @@ -113,5 +115,5 @@ postpackaging:
@echo "PACKAGE_CHKSUM = $(PACKAGE_CHKSUM)"
@echo "PACKAGE_SIZE = $(PACKAGE_SIZE)"
@echo "PACKAGE_FILENAME = $(PACKAGE_FILENAME)"
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
@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
@echo "package_$(PACKAGE_NAME)_$(PACKAGE_VERSION)_index.json created"

0 comments on commit 50d200d

Please sign in to comment.