/ .. / / -> download
README_SRC=DMC-S1KDTOOLS-A-00-00-00-00A-040A-D_EN-CA.XML
INTRO_SRC=DMC-S1KDTOOLS-A-00-00-00-00A-018A-D_EN-CA.XML
DEFAULTS_SRC=DMC-S1KDTOOLS-A-00-00-00-00A-014A-D_EN-CA.XML
INSTALL_SRC=DMC-S1KDTOOLS-A-00-00-00-00A-920A-D_EN-CA.XML
EXAMPLE_SRC=DMC-S1KDTOOLS-A-00-00-00-00A-130A-D_EN-CA.XML
COMPAT_SRC=DMC-S1KDTOOLS-A-00-00-00-00A-C30A-D_EN-CA.XML
TUTORIAL_SRC=DMC-S1KDTOOLS-A-00-00-00-00A-018B-D_EN-CA.XML

README=../README.md
INTRO=../INTRO.md
DEFAULTS=../DEFAULTS.md
INSTALL_DOC=../INSTALL.md
EXAMPLE=../EXAMPLE.md
COMPAT=../COMPATIBILITY.md
TUTORIAL=../TUTORIAL.md

S1KD2DB=s1kd2db
S1KD2DB_FLAGS+=-param include.emphasis.role 1

PANDOC_MD=pandoc -f docbook -t gfm -s
PANDOC_MD_TOC=pandoc -f docbook -t markdown | pandoc -f markdown -t gfm -s --toc
PANDOC_MAN=pandoc -f docbook -t man -s

PREFIX=/usr/local
MAN1_PREFIX=$(PREFIX)/share/man/man1
MAN5_PREFIX=$(PREFIX)/share/man/man5
INSTALL=install -D

all:

docs: s1kd-tools.1 s1kd-defaults.5 $(README) $(INTRO) $(DEFAULTS) $(INSTALL_DOC) $(EXAMPLE) $(COMPAT) $(TUTORIAL)

$(README): $(README_SRC) .icncatalog
	s1kd-icncatalog -m github $(README_SRC) | $(S1KD2DB) - $(S1KD2DB_FLAGS) | $(PANDOC_MD) -o $(README)

$(INTRO): $(INTRO_SRC)
	$(S1KD2DB) $(INTRO_SRC) $(S1KD2DB_FLAGS) | $(PANDOC_MD) -o $(INTRO)

$(DEFAULTS): $(DEFAULTS_SRC)
	$(S1KD2DB) $(DEFAULTS_SRC) $(S1KD2DB_FLAGS) | $(PANDOC_MD) -o $(DEFAULTS)

$(INSTALL_DOC): $(INSTALL_SRC)
	$(S1KD2DB) $(INSTALL_SRC) $(S1KD2DB_FLAGS) | $(PANDOC_MD) -o $(INSTALL_DOC)

$(EXAMPLE): $(EXAMPLE_SRC) .icncatalog
	s1kd-icncatalog -m github $(EXAMPLE_SRC) | $(S1KD2DB) - $(S1KD2DB_FLAGS) | $(PANDOC_MD_TOC) -o $(EXAMPLE)

$(COMPAT): $(COMPAT_SRC)
	$(S1KD2DB) $(COMPAT_SRC) $(S1KD2DB_FLAGS) | $(PANDOC_MD) -o $(COMPAT)

$(TUTORIAL): $(TUTORIAL_SRC) .icncatalog ICN-S1KDTOOLS-A-000000-A-KHZAE-00003-A-001-01.PNG
	s1kd-icncatalog -m github $(TUTORIAL_SRC) | $(S1KD2DB) - $(S1KD2DB_FLAGS) | $(PANDOC_MD_TOC) -o $(TUTORIAL)

ICN-S1KDTOOLS-A-000000-A-KHZAE-00003-A-001-01.PNG: ICN-S1KDTOOLS-A-000000-A-KHZAE-00003-A-001-01.DOT
	dot -Tpng -Gdpi=150 $< > $@

s1kd-tools.1: $(INTRO_SRC)
	$(S1KD2DB) $(INTRO_SRC) $(S1KD2DB_FLAGS) | $(PANDOC_MAN) -o $@

s1kd-defaults.5: $(DEFAULTS_SRC)
	$(S1KD2DB) $(DEFAULTS_SRC) $(S1KD2DB_FLAGS) | $(PANDOC_MAN) -o $@

.PHONY: docs clean maintainer-clean install uninstall

clean:

maintainer-clean:
	rm -f s1kd-tools.1 s1kd-defaults.5 $(README) $(INTRO) $(DEFAULTS) $(INSTALL_DOC) $(EXAMPLE) $(COMPAT)

install:
	$(INSTALL) s1kd-tools.1 $(MAN1_PREFIX)/s1kd-tools.1
	$(INSTALL) s1kd-defaults.5 $(MAN5_PREFIX)/s1kd-defaults.5

uninstall:
	rm -f $(MAN1_PREFIX)/s1kd-tools.1
	rm -f $(MAN5_PREFIX)/s1kd-defaults.5


/ gopher://khzae.net/0/s1000d/s1kd-tools/src/doc/Makefile
Styles: Light Dark Classic