aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-09-04 17:31:09 +0200
committerY. Wang <yw05@forksworld.de>2022-09-04 17:50:09 +0200
commit49beb106f00d35296c54a6f15cc663526651d376 (patch)
tree21e551a285a4f44960f50082d7ceedab667252d0 /Makefile
parent9a9023bdf8c846661596ba16b125a5ab1102a25a (diff)
downloadadvtrains-49beb106f00d35296c54a6f15cc663526651d376.tar.gz
advtrains-49beb106f00d35296c54a6f15cc663526651d376.tar.bz2
advtrains-49beb106f00d35296c54a6f15cc663526651d376.zip
Use ldoc instead of manpages
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 8 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 2754784..0275546 100644
--- a/Makefile
+++ b/Makefile
@@ -1,37 +1,22 @@
-PANDOC = pandoc
-LATEXMK = latexmk -cd -pdf -silent
-LUA = luajit
+LATEXMK = latexmk -cd -pdf -interaction=nonstopmode
MANUAL_ROOT = assets/manual
-MAN_PATH = $(MANUAL_ROOT)/man
-MAN_SRCS = $(wildcard $(MAN_PATH)/*/*.md)
-MAN_DSTS = $(MAN_SRCS:%.md=%)
-MAN_TEXS = $(MAN_SRCS:%.md=%.tex)
-MAN_FILTER = $(MANUAL_ROOT)/filter_man.lua
+LUA_SRCS = $(wildcard advtrains*/*.lua)
TEX_PATH = $(MANUAL_ROOT)/tex
-MAN_TEX_DIR = $(TEX_PATH)/man
-MAN_TEX = $(TEX_PATH)/man.tex
+TEX_ALL_SRCS = $(wildcard $(TEX_PATH)/*.tex)
TEX_MAIN_SRCS = $(wildcard $(TEX_PATH)/*manual.tex)
TEX_MAIN_DSTS = $(TEX_MAIN_SRCS:%.tex=%.pdf)
all: doc
-doc: doc-pdf doc-man
+doc: doc-pdf doc-ldoc
doc-pdf: $(TEX_MAIN_DSTS)
-%.pdf: %.tex $(MAN_TEX) $(wildcard $(TEX_PATH)/*.tex)
+%.pdf:: %.tex $(TEX_ALL_SRCS)
$(LATEXMK) $<
-doc-man: $(MAN_DSTS)
- find assets/manual/man -regex '.*/[^.]+\.[^.]+$$' | tar -cJf ${MANUAL_ROOT}/man.tar.xz -T -
-
-%:: %.md ${MAN_FILTER}
- $(PANDOC) -L ${MAN_FILTER} -s -t man -o $@ $<
-
-%.tex:: %.md ${MAN_FILTER}
- $(PANDOC) -L ${MAN_FILTER} -t latex -o $(MAN_TEX_DIR)/$(notdir $@) $<
-
-$(MAN_TEX): $(MAN_TEXS)
- find $(MAN_TEX_DIR) -name '*.tex' -printf '\\include{man/%f}\n' | sort | sed '1s/^\\include/\\input/' > $(MAN_TEX)
+doc-ldoc:: $(LUA_SRCS)
+ ldoc .
+ tar cJf assets/manual/ldoc.tar.xz -C assets/manual/ldoc_output .