aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 3d05472..41f7af8 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ MAN_TEXS = $(MAN_SRCS:%.md=%.tex)
MAN_FILTER = $(MANUAL_ROOT)/filter_man.lua
TEX_PATH = $(MANUAL_ROOT)/tex
+MAN_TEX_DIR = $(TEX_PATH)/man
MAN_TEX = $(TEX_PATH)/man.tex
TEX_MAIN_SRCS = $(wildcard $(TEX_PATH)/*manual.tex)
TEX_MAIN_DSTS = $(TEX_MAIN_SRCS:%.tex=%.pdf)
@@ -21,7 +22,7 @@ all: doc
doc: doc-pdf doc-man
doc-pdf: $(TEX_MAIN_DSTS)
-%.pdf:: %.tex $(MAN_TEX) $(wildcard $(TEX_PATH)/*.tex)
+%.pdf: %.tex $(MAN_TEX) $(wildcard $(TEX_PATH)/*.tex)
$(LATEXMK) -cd -pdf $<
doc-man: $(MAN_DSTS)
@@ -31,7 +32,7 @@ doc-man: $(MAN_DSTS)
$(PANDOC) -L ${MAN_FILTER} -s -t man -o $@ $<
%.tex:: %.md ${MAN_FILTER}
- $(PANDOC) -L ${MAN_FILTER} -t latex -o $@ $<
+ $(PANDOC) -L ${MAN_FILTER} -t latex -o $(MAN_TEX_DIR)/$(notdir $@) $<
$(MAN_TEX): $(MAN_TEXS)
- find $(MAN_PATH) -name '*.tex' -printf '\\input{../man/%P}\n' | sort > $(MAN_TEX)
+ find $(MAN_TEX_DIR) -name '*.tex' -printf '\\include{man/%f}\n' | sort | sed '1s/^\\include/\\input/' > $(MAN_TEX)