Prechádzať zdrojové kódy

make: fix VERSION unset if commit has no associated tag

Pires 1 rok pred
rodič
commit
60c5ffe3fe
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      Makefile

+ 2 - 1
Makefile

@@ -11,7 +11,8 @@ BIN = $(OUT)/bin
 
 
 -include Makefile.help
 -include Makefile.help
 
 
-VERSION = $(shell git describe --tags --dirty)
+# VERSION is the git tag of the current commit if there's a tag, otherwise it's "dev-" plus the git commit sha.
+VERSION = $(shell git describe --tags --dirty 2>/dev/null || echo "dev-$(shell git rev-parse --short HEAD)")
 
 
 .PHONY: dirs
 .PHONY: dirs
 dirs: Makefile
 dirs: Makefile