mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-24 05:23:06 +00:00
08f7a290a4
* CI: Fix git.mk & post a quick flash link on PR builds * Makefile: optimize shell invocation in git helper, conditional dependency load. * Github: better variable naming Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
13 lines
611 B
Makefile
13 lines
611 B
Makefile
GIT_COMMIT := $(shell git rev-parse --short HEAD || echo 'unknown')
|
|
GIT_BRANCH := $(shell echo $${WORKFLOW_BRANCH_OR_TAG-$$(git rev-parse --abbrev-ref HEAD || echo 'unknown')})
|
|
GIT_BRANCH_NUM := $(shell git rev-list --count HEAD || echo 'nan')
|
|
BUILD_DATE := $(shell date '+%d-%m-%Y' || echo 'unknown')
|
|
VERSION := $(shell git describe --tags --abbrev=0 --exact-match || echo 'unknown')
|
|
|
|
CFLAGS += \
|
|
-DGIT_COMMIT="\"$(GIT_COMMIT)\"" \
|
|
-DGIT_BRANCH="\"$(GIT_BRANCH)\"" \
|
|
-DGIT_BRANCH_NUM="\"$(GIT_BRANCH_NUM)\"" \
|
|
-DBUILD_DATE="\"$(BUILD_DATE)\"" \
|
|
-DTARGET="\"$(TARGET)\"" \
|
|
-DVERSION="\"$(VERSION)\""
|