forked from tildeverse/zine
add local test server option
This commit is contained in:
parent
8c66e6d911
commit
87c5122782
18
Makefile
18
Makefile
|
@ -10,14 +10,17 @@ DEST_EPUB_FILES := $(ISSUES:./issues/%=$(DEST_DIR)/issue-%.epub)
|
||||||
# deps
|
# deps
|
||||||
PANDOC != command -v pandoc 2> /dev/null
|
PANDOC != command -v pandoc 2> /dev/null
|
||||||
XELATEX != command -v xelatex 2> /dev/null
|
XELATEX != command -v xelatex 2> /dev/null
|
||||||
|
PHP != command -v php 2> /dev/null
|
||||||
|
|
||||||
# default target
|
# default target
|
||||||
help:
|
help:
|
||||||
$(info all - build all formats)
|
$(info all - build all formats)
|
||||||
$(info pdf - generate all issues as pdf)
|
$(info pdf - generate all issues as pdf - requires xelatex)
|
||||||
$(info html - generate all issues as html)
|
$(info html - generate all issues as html)
|
||||||
$(info epub - generate all issues as epub)
|
$(info epub - generate all issues as epub)
|
||||||
$(info clean - remove build artifacts)
|
$(info clean - remove build artifacts)
|
||||||
|
$(info serve - start local php test server - requires php)
|
||||||
|
$(info note: all builds require pandoc)
|
||||||
|
|
||||||
all: dep-pandoc pdf html epub
|
all: dep-pandoc pdf html epub
|
||||||
|
|
||||||
|
@ -73,7 +76,11 @@ $(DEST_DIR)/issue-%.epub: issues/%
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(info removing build artifacts)
|
$(info removing build artifacts)
|
||||||
@rm $(DEST_DIR)/*.{pdf,html,epub}
|
@rm $(DEST_DIR)/issue-*
|
||||||
|
|
||||||
|
serve: dep-php
|
||||||
|
$(info starting local php server)
|
||||||
|
@$(PHP) -S localhost:9000 -t $(DEST_DIR)
|
||||||
|
|
||||||
dep-pandoc:
|
dep-pandoc:
|
||||||
ifndef PANDOC
|
ifndef PANDOC
|
||||||
|
@ -85,5 +92,10 @@ ifndef XELATEX
|
||||||
$(error missing dependency 'xelatex'. please install and try again)
|
$(error missing dependency 'xelatex'. please install and try again)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: clean help dep-pandoc dep-xelatex
|
dep-php:
|
||||||
|
ifndef PHP
|
||||||
|
$(error missing dependency 'php'. please install and try again)
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: clean serve help dep-pandoc dep-xelatex dep-php
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue