32 lines
689 B
Makefile
32 lines
689 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 \
|
|
$<
|
|
|
|
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
|
|
|