]> git.tuebingen.mpg.de Git - lopsub.git/blobdiff - Makefile
Fix three typos.
[lopsub.git] / Makefile
index 408e3a5ac123dff22cd744a1487e18de3ed53c64..e8fb7c0b3743a8655e74a7e66f441efea02dd382 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,10 +18,18 @@ AR := ar
 GROFF := groff
 CP := cp
 INSTALL := install
-GZIP := gzip -f9
+GZIP := gzip -fn9
 ZCAT := zcat
 
-DATE := $(shell date '+%B %Y')
+DATE_FMT := +%B %Y
+# To get a reproducible build, we use $(SOURCE_DATE_EPOCH) instead of the
+# current time if this variable is set.
+ifdef SOURCE_DATE_EPOCH
+       DATE := $(shell LC_ALL=C date -u -d '@$(SOURCE_DATE_EPOCH)' \
+               '$(DATE_FMT)' 2>/dev/null || LC_ALL=C date -u '$(DATE_FMT)')
+else
+       DATE := $(shell date '$(DATE_FMT)')
+endif
 GIT_VERSION := $(shell ./version-gen.sh)
 PLAIN_VERSION := $(firstword $(subst -, , $(GIT_VERSION)))
 MAJOR_VERSION := $(firstword $(subst ., , $(PLAIN_VERSION)))