pass version to gcc derived from git describe

This commit is contained in:
Conor Patrick
2019-02-12 16:37:09 -05:00
parent 020fe21546
commit bc8984aac3
4 changed files with 26 additions and 11 deletions

View File

@ -0,0 +1,19 @@
CC=$(PREFIX)arm-none-eabi-gcc
CP=$(PREFIX)arm-none-eabi-objcopy
SZ=$(PREFIX)arm-none-eabi-size
AR=$(PREFIX)arm-none-eabi-ar
VERSION=$(shell git describe --abbrev=0 )
VERSION_FULL=$(shell git describe)
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])')
VERSION_FLAGS= -DSOLO_VERSION_MAJ=$(VERSION_MAJ) -DSOLO_VERSION_MIN=$(VERSION_MIN) \
-DSOLO_VERSION_PATCH=$(VERSION_PAT) -DVERSION=\"$(VERSION_FULL)\"
_all:
echo $(VERSION_FULL)
echo $(VERSION_MAJ)
echo $(VERSION_MIN)
echo $(VERSION_PAT)