stm32f4-uart-bootloader

Simple UART bootloader for STM32F4 MCU's
git clone git://git.mdnr.space/stm32f4-uart-bootloader
Log | Files | Refs | Submodules | README | LICENSE

make-version.mk (1018B)


      1 GLOBAL_DIR = $(SRC_DIR)/globals
      2 ###############################################################################
      3 # Versioning
      4 VERSION = $(shell git describe --always --abbrev=4 --long)
      5 VERSION_MAJOR = $(shell git describe --always --long | sed "s/^v\([0-9]\+\).*/\1/")
      6 VERSION_MINOR = $(shell git describe --always --long | sed "s/^v[0-9]\+\.\([0-9]\+\).*/\1/")
      7 VERSION_PATCH = $(shell git describe --always --long | sed "s/^v[0-9]\+\.[0-9]\+-\([0-9]\+\).*/\1/")
      8 VERSION_HASH  = $(shell git describe --always --abbrev=4 --long | sed "s/^v[0-9]\+\.[0-9]\+-[0-9]\+-\([a-Z0-9]\{5\}\).*/\1/")
      9 
     10 VERSION_FILE = $(GLOBAL_DIR)/version.h
     11 
     12 version: | $(VERSION_FILE)
     13 	$(Q)printf "// fw version: $(VERSION)\n \
     14 	#include <stdint.h>\n \
     15 	const uint8_t gGIT_VERSION_MAJOR = $(VERSION_MAJOR);\n \
     16 	const uint8_t gGIT_VERSION_MINOR = $(VERSION_MINOR);\n \
     17 	const uint8_t gGIT_VERSION_PATCH = $(VERSION_PATCH);\n \
     18 	#define gGIT_VERSION_HASH \"$(VERSION_HASH)\"\n" > $(VERSION_FILE)
     19 
     20 $(VERSION_FILE):
     21 	$(shell touch $(VERSION_FILE)) \