Browse Source

Makefile: Set correct version string when git is not used.

Georgi Chorbadzhiyski 8 years ago
parent
commit
0350c6917e
1 changed files with 9 additions and 2 deletions
  1. 9 2
      Makefile

+ 9 - 2
Makefile View File

@@ -1,8 +1,15 @@
1 1
 CC = $(CROSS)$(TARGET)gcc
2 2
 STRIP = $(CROSS)$(TARGET)strip
3 3
 BUILD_ID = $(shell date +%F_%R)
4
-GIT_VER = $(shell git describe --tags --dirty --always)
5
-CFLAGS = -ggdb -Wall -Wextra -Wshadow -Wformat-security -Wno-strict-aliasing -O2 -D_GNU_SOURCE -DBUILD_ID=\"$(BUILD_ID)\" -DGIT_VER=\"$(GIT_VER)\"
4
+VERSION="v1.0"
5
+GIT_VER = $(shell git describe --tags --dirty --always 2>/dev/null)
6
+CFLAGS = -ggdb -Wall -Wextra -Wshadow -Wformat-security -Wno-strict-aliasing -O2 -D_GNU_SOURCE -DBUILD_ID=\"$(BUILD_ID)\"
7
+ifneq "$(GIT_VER)" ""
8
+CFLAGS += -DGIT_VER=\"$(GIT_VER)\"
9
+else
10
+CFLAGS += -DGIT_VER=\"$(VERSION)\"
11
+endif
12
+
6 13
 RM = /bin/rm -f
7 14
 Q = @
8 15