flipperzero-firmware/make/git.mk
Albert Kharisov aa20a78b0e
[FL-164] Add bootloader version (#417)
* Add bootloader versioning
* Move some logic to api-hal-version
* Backport to f4
* Dolphin: update version screen layout, make it more readable

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-04-19 19:30:25 +03:00

10 lines
572 B
Makefile

GIT_COMMIT = $(shell git describe --always --exclude '*' || echo 'unknown')
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD || echo 'unknown')
GIT_BRANCH_NUM = $(shell git rev-list --count $(GIT_BRANCH) || echo 'nan')
BUILD_DATE = $(shell date '+%d-%m-%Y' || echo 'unknown')
VERSION = $(shell git describe --tags --abbrev=0 || echo 'unknown')
CFLAGS += -DGIT_COMMIT="\"$(GIT_COMMIT)\"" -DGIT_BRANCH="\"$(GIT_BRANCH)\"" -DGIT_BRANCH_NUM="\"$(GIT_BRANCH_NUM)\""
CFLAGS += -DBUILD_DATE="\"$(BUILD_DATE)\"" -DTARGET="\"$(TARGET)\"" -DVERSION="\"$(VERSION)\""