summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDhole <dhole@openmailbox.org>2015-06-24 17:46:28 +0200
committerPali Rohár <pali.rohar@gmail.com>2015-06-24 17:46:28 +0200
commit94a2fe0c17cac00c679cd08f9d8c3f6e78fa09a4 (patch)
treea8afd3ca5fcf45c3870dc1d9acf2360e3cd59c58 /src
parent289d2f22b237e901853566c8588800ac9f189847 (diff)
download0xFFFF-94a2fe0c17cac00c679cd08f9d8c3f6e78fa09a4.tar.bz2
mangen: Set build date externally
Patch build system to allow the build date in the man entry to be set externally. In Debian it will be set to the latest debian/changelog entry for reproducibility.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile4
-rw-r--r--src/mangen.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index cad52e3..6b8ef08 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,11 +3,13 @@ include ../config.mk
PREFIX ?= /usr/local
INSTALL ?= install
+BUILD_DATE ?= $(shell LC_ALL=C date '+%b %e %Y')
+
CC = gcc
CROSS_CC = $(CROSS_COMPILE)$(CC)
HOST_CC = $(HOST_COMPILE)$(CC)
-CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L
+CPPFLAGS += -DVERSION=\"$(VERSION)\" -DBUILD_DATE="\"$(BUILD_DATE)\"" -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L
CFLAGS += -W -Wall -O2 -pedantic -std=c99
LIBS += -lusb
diff --git a/src/mangen.c b/src/mangen.c
index d2bf89a..6f5a2fa 100644
--- a/src/mangen.c
+++ b/src/mangen.c
@@ -25,6 +25,10 @@
#define INFO NAME " \\- Open Free Fiasco Firmware Flasher, version " VERSION
#define DESCRIPTION "0xFFFF is Open Free Fiasco Firmware Flasher for Maemo devices. It support generating and unpacking FIASCO images on local computer. Useful for editing Maemo firmware package for future flash. It support via USB flashing any image type to Maemo device and also \"cold\" flashing which means flashing dead device with erased bootloader. There is support for booting kernel via USB without flashing to NAND and also changing configuration of Maemo device (enable/disable R&D mode, changing HW revision strings, ...).\n\n0xFFFF is alternative tool to proprietary Nokia flasher-3.5 and fiasco-gen. 0xFFFF generate compatible FIASCO images and also accept FIASCO images generated by Nokia fiasco-gen."
+#ifndef BUILD_DATE
+#define BUILD_DATE __DATE__
+#endif
+
int main() {
FILE * pipe;
@@ -34,7 +38,7 @@ int main() {
if ( ! pipe )
return 1;
- puts(".TH " NAME " 1 \"" __DATE__ "\" \"" NAME " " VERSION "\"");
+ puts(".TH " NAME " 1 \"" BUILD_DATE "\" \"" NAME " " VERSION "\"");
puts("");
puts(".SH NAME");