diff --git a/port/arduino/Makefile b/port/arduino/Makefile index 88a9ff7ac..1bad21982 100644 --- a/port/arduino/Makefile +++ b/port/arduino/Makefile @@ -4,9 +4,7 @@ DIR=. BTSTACK_ROOT=${realpath ../..} -DUMMY=$(shell ) -VERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' ${BTSTACK_ROOT}/platform/daemon/src/btstack_version.h` -BTSTACK_PACKAGE=/tmp/btstack +VERSION=$(shell ${BTSTACK_ROOT}/tool/get_git_version.sh) ARCHIVE=$(BTSTACK_ROOT)/btstack-arduino-${VERSION}.zip SRC_C_FILES = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c btstack_run_loop.c btstack_crypto.c @@ -30,9 +28,6 @@ ARDUINO_LIBS=~/Documents/arduino/libraries/BTstack all: release -clean: - rm -rf ${BTSTACK_PACKAGE} - update_version: ${BTSTACK_ROOT}/tool/get_version.sh diff --git a/tool/get_git_version.sh b/tool/get_git_version.sh new file mode 100755 index 000000000..002c2a2c3 --- /dev/null +++ b/tool/get_git_version.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +# get tag from git +tag=`git tag --points-at HEAD` + +# get git version +commit=`git rev-parse --short HEAD` + +# use tag if available +if [ -z "$tag" ] +then + version=${commit} +else + version=${tag}-${commit} +fi + +echo "${version}"