Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken SOURCE_DATE_EPOCH in docs.mk #479

Merged
merged 1 commit into from
Feb 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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