# Makefile for SDP docs from AsciiDoctor format to HTML and PDF SRC = $(wildcard *.adoc) PDF = $(SRC:.adoc=.pdf) HTML = $(SRC:.adoc=.html) SCRIPT_MAN_PAGE_GENERATOR = ../../tools/gen_script_man_pages.sh # Warning: Using a wildcard here eases maintenance, but will # not trigger a make if generated doc files are removed. Handle # such a situation manually. SDP_GUIDE_UNIX_GENDOCS = $(wildcard gen/*.man.txt) SDP_LEGACY_UPGRADES_GENDOCS = gen/clear_depot_Map_fields.sh.man.txt # Default target 'all' builds PDF and HTML from *.adoc files. For # any referenced generated man pages, current files in the 'gen' # directory are used. See 'full'. all: $(PDF) $(HTML) # The 'full' target ensures docs are generated from the latest # files. It does a 'p4 sync' in the SDP workspace to ensure # we have the latest scripts. # # WARNING: The 'full' target does a 'p4 sync' and could potentially # schedule a resolve. If a resolve is needed for scripts from # which docs are generated, generated docs will be incorrect. full: $(PDF) $(HTML) GenerateScriptManPages .PHONY: GenerateScriptManPages GenerateScriptManPages: p4 -s sync $(SCRIPT_MAN_PAGE_GENERATOR) -rec # General Rule for converting AsciiDoc files to HTML. %.html: %.adoc rm -f $@ asciidoctor $^ # General Rule for converting AsciiDoc files to PDF. %.pdf: %.adoc rm -f $@ asciidoctor-pdf -a pdf-themesdir=themes -a pdf-theme=basic $^ # Specific Rule for building SDP_Guide.Unix.html with generated docs. SDP_Guide.Unix.html: SDP_Guide.Unix.adoc $(SDP_GUIDE_UNIX_GENDOCS) rm -f SDP_Guide.Unix.html asciidoctor SDP_Guide.Unix.adoc # Specific Rule for building SDP_Guide.Unix.pdf with generated docs. SDP_Guide.Unix.pdf: SDP_Guide.Unix.adoc $(SDP_GUIDE_UNIX_GENDOCS) rm -f SDP_Guide.Unix.pdf asciidoctor-pdf -a pdf-themesdir=themes -a pdf-theme=basic SDP_Guide.Unix.adoc # Specific Rule for buildlng SDP_Legacy_Upgrades.Unix.html with generated docs: SDP_Legacy_Upgrades.Unix.html: SDP_Legacy_Upgrades.Unix.adoc $(SDP_LEGACY_UPGRADES_GENDOCS) rm -f SDP_Legacy_Upgrades.Unix.html asciidoctor SDP_Legacy_Upgrades.Unix.adoc # Specific Rule for building SDP_Legacy_Upgrades.Unix.pdf with generated docs. SDP_Legacy_Upgrades.Unix.pdf: SDP_Legacy_Upgrades.Unix.adoc $(SDP_LEGACY_UPGRADES_GENDOCS) rm -f SDP_Legacy_Upgrades.Unix.pdf asciidoctor-pdf -a pdf-themesdir=themes -a pdf-theme=basic SDP_Legacy_Upgrades.Unix.adoc .PHONY: clean rec clean: rm -f $(PDF) $(HTML) rec: p4 rec