add local test server option

This commit is contained in:
Ben Harris 2019-10-02 23:22:32 -04:00
parent 8c66e6d911
commit 87c5122782
1 changed files with 15 additions and 3 deletions

View File

@ -10,14 +10,17 @@ DEST_EPUB_FILES := $(ISSUES:./issues/%=$(DEST_DIR)/issue-%.epub)
# deps
PANDOC != command -v pandoc 2> /dev/null
XELATEX != command -v xelatex 2> /dev/null
PHP != command -v php 2> /dev/null
# default target
help:
$(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 epub - generate all issues as epub)
$(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
@ -73,7 +76,11 @@ $(DEST_DIR)/issue-%.epub: issues/%
clean:
$(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:
ifndef PANDOC
@ -85,5 +92,10 @@ ifndef XELATEX
$(error missing dependency 'xelatex'. please install and try again)
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