# Makefile for SDP docs from AsciiDoctor format 
# To HTML and PDF

SRC = $(wildcard *.adoc)

PDF = $(SRC:.adoc=.pdf)

HTML = $(SRC:.adoc=.html)

POD_HTML = JobIncrement.html

all:	$(PDF) $(HTML) $(POD_HTML)

# Add dependencies for included HTML.
Unsupported_SDP.adoc: JobIncrement.html

# General rule for building *.pdf from *.adoc.
%.pdf: %.adoc
	rm -f $@
	asciidoctor-pdf -a pdf-themesdir=themes -a pdf-theme=basic $^ 

# General rule for building *.html from *.adoc.
%.html: %.adoc
	rm -f $@
	asciidoctor $^

# Specific Rule for script with HTML built from pod2html.
JobIncrement.html: ../Samples/triggers/JobIncrement.pl
	rm -f $@
	pod2html $^ > $@
	rm -f pod2*.tmp

.PHONY: clean

clean:
	rm -f $(PDF) $(HTML) $(POD_HTML)
