Files
openpilot-evo/panda/common/version.mk
T
Vehicle Researcher 9032365ea1 Merge commit '3966ad4c4d9052a39cef759cea211d614613f285' as 'panda'
old-commit-hash: 983120bfed09ad9331fa96be3143a604c9a1a179
2019-06-28 21:09:12 +00:00

21 lines
925 B
Makefile

ifeq ($(RELEASE),1)
BUILD_TYPE = "RELEASE"
else
BUILD_TYPE = "DEBUG"
endif
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
ifneq ($(wildcard $(SELF_DIR)/../.git/HEAD),)
obj/gitversion.h: $(SELF_DIR)/../VERSION $(SELF_DIR)/../.git/HEAD $(SELF_DIR)/../.git/index
echo "const uint8_t gitversion[] = \"$(shell cat $(SELF_DIR)/../VERSION)-$(BUILDER)-$(shell git rev-parse --short=8 HEAD)-$(BUILD_TYPE)\";" > $@
else
ifneq ($(wildcard $(SELF_DIR)/../../.git/modules/panda/HEAD),)
obj/gitversion.h: $(SELF_DIR)/../VERSION $(SELF_DIR)/../../.git/modules/panda/HEAD $(SELF_DIR)/../../.git/modules/panda/index
echo "const uint8_t gitversion[] = \"$(shell cat $(SELF_DIR)/../VERSION)-$(BUILDER)-$(shell git rev-parse --short=8 HEAD)-$(BUILD_TYPE)\";" > $@
else
obj/gitversion.h: $(SELF_DIR)/../VERSION
echo "const uint8_t gitversion[] = \"$(shell cat $(SELF_DIR)/../VERSION)-$(BUILDER)-unknown-$(BUILD_TYPE)\";" > $@
endif
endif