2021-08-08 01:54:37 +03:00
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
2021-08-12 11:24:18 +03:00
|
|
|
ARGS :=
|
|
|
|
|
|
2021-09-03 05:18:18 +03:00
|
|
|
# NOTE: need to run latex two times to build index, the simpler way to
|
|
|
|
|
# go is to use latexmk...
|
2021-09-03 04:03:28 +03:00
|
|
|
#TEX := lualatex $(ARGS)
|
2021-09-03 05:18:18 +03:00
|
|
|
|
2021-09-03 04:03:28 +03:00
|
|
|
TEX := latexmk -lualatex $(ARGS)
|
2021-08-08 01:54:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# Generate docs from latex package/class...
|
|
|
|
|
#
|
2021-08-10 11:46:41 +03:00
|
|
|
# - keep lines starting with \def\<module-name>@[A-Z]\+
|
2021-08-10 06:14:42 +03:00
|
|
|
# - keep lines starting with '%%'
|
2021-08-08 01:54:37 +03:00
|
|
|
# - %%%%% Text -> \subsection(Text)
|
2021-08-08 15:44:20 +03:00
|
|
|
# - %%%% Text -> \section(Text)
|
2021-08-08 01:54:37 +03:00
|
|
|
# - %% >> code -> \begin{verbatim}code\end{verbatim}
|
|
|
|
|
#
|
|
|
|
|
# NOTE: the idea of keeping latex docs in a latex file is far similar
|
|
|
|
|
# than all the stuff crammed into .dtx, at least for my needs:
|
|
|
|
|
# - keep the code readable
|
|
|
|
|
# - keep the docs readable
|
|
|
|
|
# in both the repo and in installed form.
|
|
|
|
|
# NOTE: this is evolving as need arises, when this gets too complicated
|
|
|
|
|
# we'll split it out into it's own script.
|
2021-11-09 06:46:22 +03:00
|
|
|
#
|
2021-10-10 06:40:44 +03:00
|
|
|
# XXX BUG: for some odd reason this produces different results when called
|
|
|
|
|
# from 'bash' and 'bash --login -i', mainly the egrep rule seems
|
|
|
|
|
# to be broken...
|
2021-11-09 06:46:22 +03:00
|
|
|
# ...also appears to be broken under termux...
|
|
|
|
|
# .....seems that moving this out to a script would be the simplest way
|
|
|
|
|
# to solve this odd instability...
|
2021-08-11 20:37:16 +03:00
|
|
|
texToDoc = \
|
|
|
|
|
@echo "texToDoc: $1 -> $2"; \
|
2021-11-13 13:23:08 +03:00
|
|
|
./scripts/cls2tex.sh $1 $2 $3
|
2021-08-11 20:37:16 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-22 14:52:34 +03:00
|
|
|
#----------------------------------------------------------------------
|
2021-08-11 20:37:16 +03:00
|
|
|
|
|
|
|
|
%.pdf: %.tex
|
|
|
|
|
$(TEX) $< > /dev/null
|
|
|
|
|
|
|
|
|
|
|
2021-08-12 11:24:18 +03:00
|
|
|
# NOTE: .sty and .cls are essentially the same in terms of documentation
|
|
|
|
|
# generation...
|
2021-09-03 03:28:04 +03:00
|
|
|
%.tex: %.sty %-meta.tex
|
|
|
|
|
$(call texToDoc,$<,$@,%)
|
2021-08-11 20:37:16 +03:00
|
|
|
|
2021-09-03 03:28:04 +03:00
|
|
|
%.tex: %.cls %-meta.tex
|
|
|
|
|
$(call texToDoc,$<,$@,%)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# NOTE: this is a bit ugly, but allot less so than trying to push \verb
|
|
|
|
|
# into a LaTeX macro/env and then getting it out again in one pice...
|
|
|
|
|
%-meta.tex: %.sty
|
|
|
|
|
$(call texToDoc,$<,$@,M)
|
|
|
|
|
|
|
|
|
|
%-meta.tex: %.cls
|
|
|
|
|
$(call texToDoc,$<,$@,M)
|
2021-08-11 20:37:16 +03:00
|
|
|
|
|
|
|
|
|
2021-08-08 01:54:37 +03:00
|
|
|
|
2021-08-08 14:07:52 +03:00
|
|
|
#----------------------------------------------------------------------
|
2021-08-22 14:52:34 +03:00
|
|
|
|
|
|
|
|
.PHONY: doc
|
|
|
|
|
doc: photobook.pdf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
|
all: doc sweep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# XXX
|
|
|
|
|
.PHONY: dist
|
|
|
|
|
dist: all
|
|
|
|
|
|
2021-08-08 14:07:52 +03:00
|
|
|
# XXX install... (see: ./tmp/Makefile)
|
2021-08-22 14:52:34 +03:00
|
|
|
# - local
|
|
|
|
|
# - root
|
|
|
|
|
.PHONY: install
|
|
|
|
|
install: dist
|
|
|
|
|
|
2021-08-08 14:07:52 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
2021-08-08 01:54:37 +03:00
|
|
|
|
|
|
|
|
.PHONY: sweep
|
|
|
|
|
sweep:
|
2021-09-03 04:03:28 +03:00
|
|
|
rm -f *.{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out,toc,fdb_latexmk}
|
2021-08-08 01:54:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
clean: sweep
|
|
|
|
|
rm -f *.pdf
|
|
|
|
|
|
|
|
|
|
|
2021-08-22 14:52:34 +03:00
|
|
|
|
2021-08-08 01:54:37 +03:00
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
# vim:set ts=4 sw=4 :
|