Browse Source

Merge pull request #16 from AMDmi3/reproducible-build

Georgi Chorbadzhiyski 1 year ago
parent
commit
21bf4ea0e4
No account linked to committer's email
2 changed files with 7 additions and 1 deletions
  1. 3 1
      Makefile
  2. 4 0
      mptsd.c

+ 3 - 1
Makefile View File

@@ -1,8 +1,10 @@
1 1
 CC? = $(CROSS)$(TARGET)gcc
2 2
 STRIP = $(CROSS)$(TARGET)strip
3
-BUILD_ID = $(shell date +%F_%R)
4 3
 VERSION="v1.1"
4
+ifndef REPRODUCIBLE_BUILD
5
+BUILD_ID = $(shell date +%F_%R)
5 6
 GIT_VER = $(shell git describe --tags --dirty --always 2>/dev/null)
7
+endif
6 8
 CFLAGS ?= -ggdb -O2
7 9
 CFLAGS += -Wall -Wextra -Wshadow -Wformat-security -Wno-strict-aliasing -D_GNU_SOURCE -DBUILD_ID=\"$(BUILD_ID)\"
8 10
 ifneq "$(GIT_VER)" ""

+ 4 - 0
mptsd.c View File

@@ -34,7 +34,11 @@
34 34
 
35 35
 #define PROGRAM_NAME "ux-mptsd"
36 36
 
37
+#ifdef BUILD_ID
37 38
 const char *program_id = PROGRAM_NAME " " GIT_VER " build " BUILD_ID;
39
+#else
40
+const char *program_id = PROGRAM_NAME " " GIT_VER;
41
+#endif
38 42
 
39 43
 char *server_sig = PROGRAM_NAME;
40 44
 char *server_ver = GIT_VER;