forked from tildeverse/zine
add local test server option
parent
8c66e6d911
commit
87c5122782
18
Makefile
18
Makefile
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue