Skip to content

Commit

Permalink
Fix broken SOURCE_DATE_EPOCH in docs.mk (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Feb 28, 2021
1 parent b3067d6 commit c93b628
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAN_FILES := man/shards.1 man/shard.yml.5
HTML_FILES := docs/shards.html docs/shard.yml.html

SHARDS_VERSION := $(shell cat VERSION)
source_date_epoch := $(shell (git show -s --format=%ct HEAD || stat -c "%Y" $(1) || stat -f "%m" $(1)) 2> /dev/null)
SOURCE_DATE_EPOCH := $(shell (git show -s --format=%ct HEAD || stat -c "%Y" Makefile || stat -f "%m" Makefile) 2> /dev/null)

docs: manpages

Expand All @@ -15,10 +15,10 @@ manpages: $(MAN_FILES)
htmlpages: $(HTML_FILES)

man/%.1 man/%.5: docs/%.adoc
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOC) $(ASCIIDOC_OPTIONS) $< -b manpage -o $@
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) $(ASCIIDOC) $(ASCIIDOC_OPTIONS) $< -b manpage -o $@

docs/%.html: docs/%.adoc
SOURCE_DATE_EPOCH=$(call source_date_epoch,$<) $(ASCIIDOC) $(ASCIIDOC_OPTIONS) $< -b html5 -o $@
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) $(ASCIIDOC) $(ASCIIDOC_OPTIONS) $< -b html5 -o $@

clean_docs: phony
rm -f $(MAN_FILES)
Expand Down

0 comments on commit c93b628

Please sign in to comment.