[airborne] add pprz_version and send it with BOOT

This commit is contained in:
Felix Ruess
2014-12-18 19:31:32 +01:00
parent ec828744ea
commit 19fdef9c68
8 changed files with 108 additions and 9 deletions
+22 -1
View File
@@ -76,6 +76,27 @@ else # not auto, explicitly specified
NPROCS := $J
endif
#
# export paparazzi version
#
GIT_SHA1 := $(shell git log -1 --pretty=format:%H 2> /dev/null)
ifneq ($(words $(GIT_SHA1)),1)
GIT_SHA1 := "UNKNOWN"
endif
GIT_DESC := $(shell ./paparazzi_version)
PPRZ_VER := $(shell echo $(GIT_DESC) | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
PPRZ_VER_MAJOR := $(shell echo $(GIT_DESC) | sed 's/v\([0-9]*\).*/\1/')
PPRZ_VER_MINOR := $(shell echo $(GIT_DESC) | sed 's/v[0-9]*.\([0-9]*\).*/\1/')
PPRZ_VER_PATCH := $(shell echo $(GIT_DESC) | sed 's/v[0-9]*.[0-9]*.\([0-9]*\).*/\1/')
ifneq ($(words $(PPRZ_VER_PATCH)),1)
PPRZ_VER_PATCH := 0
endif
export GIT_DESC
export GIT_SHA1
export PPRZ_VER_MAJOR
export PPRZ_VER_MINOR
export PPRZ_VER_PATCH
# "make Q=''" to get full echo
Q=@
@@ -105,7 +126,7 @@ init:
print_version:
@echo "-----------------------------------------------------------------------"
@echo "Paparazzi version" $(shell ./paparazzi_version)
@echo "Paparazzi version" $(GIT_DESC)
@echo "-----------------------------------------------------------------------"