33 lines
712 B
Makefile
33 lines
712 B
Makefile
|
DEST := public
|
||
|
|
||
|
SRC_FILES != find . -type f -name '*.adoc' ! -name 'README.adoc'
|
||
|
DST_FILES := $(SRC_FILES:%.adoc=$(DEST)/%.html)
|
||
|
|
||
|
ASCIIDOCTOR != command -v asciidoctor 2> /dev/null
|
||
|
|
||
|
all: dep-asciidoctor $(DST_FILES)
|
||
|
|
||
|
$(DEST)/%.html: %.adoc
|
||
|
$(info building $@)
|
||
|
@$(ASCIIDOCTOR) \
|
||
|
--destination-dir=$(DEST) \
|
||
|
--attribute stylesheet=./$(DEST)/stylesheets/dark.css \
|
||
|
--attribute toc=on \
|
||
|
$<
|
||
|
|
||
|
clean:
|
||
|
$(info removing generated html files)
|
||
|
-rm $(DEST)/*.html
|
||
|
|
||
|
watch:
|
||
|
$(info watching files for rebuild)
|
||
|
find . -type f -name '*.adoc' ! -name 'README.adoc' | entr make
|
||
|
|
||
|
dep-asciidoctor::
|
||
|
ifndef ASCIIDOCTOR
|
||
|
$(error missing dependency 'asciidoctor'. please install and try again.)
|
||
|
endif
|
||
|
|
||
|
.PHONY: clean watch
|
||
|
|