Browse Source

Merge pull request #16 from AMDmi3/reproducible-build

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

+ 3
- 1
Makefile View File

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

+ 4
- 0
mptsd.c View File

34
 
34
 
35
 #define PROGRAM_NAME "ux-mptsd"
35
 #define PROGRAM_NAME "ux-mptsd"
36
 
36
 
37
+#ifdef BUILD_ID
37
 const char *program_id = PROGRAM_NAME " " GIT_VER " build " BUILD_ID;
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
 char *server_sig = PROGRAM_NAME;
43
 char *server_sig = PROGRAM_NAME;
40
 char *server_ver = GIT_VER;
44
 char *server_ver = GIT_VER;

Loading…
Cancel
Save