diff --git a/Makefile b/Makefile index 7272a49..60c1eb6 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,8 @@ else endif LDFLAGS += $(LIBCBOR) -VERSION:=$(shell git describe --abbrev=0 ) VERSION_FULL:=$(shell git describe) +VERSION:=$(shell python -c 'print("$(VERSION_FULL)".split("-")[0])') VERSION_MAJ:=$(shell python -c 'print("$(VERSION)".split(".")[0])') VERSION_MIN:=$(shell python -c 'print("$(VERSION)".split(".")[1])') VERSION_PAT:=$(shell python -c 'print("$(VERSION)".split(".")[2])') diff --git a/in-docker-build.sh b/in-docker-build.sh index 395a5a1..7edfcbc 100755 --- a/in-docker-build.sh +++ b/in-docker-build.sh @@ -1,14 +1,9 @@ #!/bin/bash -xe - -version=${1:-master} +version=$1 export PREFIX=/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/ cd /solo/targets/stm32l432 -git fetch --tags -git checkout ${version} -git submodule update --init --recursive -version=$(git describe) make cbor @@ -22,7 +17,7 @@ function build() { make full-clean - make ${what} + make ${what} VERSION_FULL=${version} out_hex="${what}-${version}.hex" out_sha2="${what}-${version}.sha2" diff --git a/targets/stm32l432/Makefile b/targets/stm32l432/Makefile index 667256b..c2e349f 100644 --- a/targets/stm32l432/Makefile +++ b/targets/stm32l432/Makefile @@ -2,8 +2,8 @@ ifndef DEBUG DEBUG=0 endif -APPMAKE=build/application.mk -BOOTMAKE=build/bootloader.mk +APPMAKE=build/application.mk VERSION_FULL=${VERSION_FULL} +BOOTMAKE=build/bootloader.mk VERSION_FULL=${VERSION_FULL} merge_hex=solo mergehex diff --git a/targets/stm32l432/build/common.mk b/targets/stm32l432/build/common.mk index c6901d7..18147f0 100644 --- a/targets/stm32l432/build/common.mk +++ b/targets/stm32l432/build/common.mk @@ -13,8 +13,8 @@ USB_LIB := lib/usbd/usbd_cdc.c lib/usbd/usbd_cdc_if.c lib/usbd/usbd_composite.c lib/usbd/usbd_ctlreq.c lib/usbd/usbd_desc.c lib/usbd/usbd_hid.c \ lib/usbd/usbd_ccid.c -VERSION:=$(shell git describe --abbrev=0 ) -VERSION_FULL:=$(shell git describe) +VERSION_FULL?=$(shell git describe) +VERSION:=$(shell python -c 'print("$(VERSION_FULL)".split("-")[0])') VERSION_MAJ:=$(shell python -c 'print("$(VERSION)".split(".")[0])') VERSION_MIN:=$(shell python -c 'print("$(VERSION)".split(".")[1])') VERSION_PAT:=$(shell python -c 'print("$(VERSION)".split(".")[2])')