@@@ yet more mess
[sod] / doc / Makefile.am
1 ### -*-makefile-*-
2 ###
3 ### Build script for the manual
4 ###
5 ### (c) 2015 Straylight/Edgeware
6 ###
7
8 ###----- Licensing notice ---------------------------------------------------
9 ###
10 ### This file is part of the Sensible Object Design, an object system for C.
11 ###
12 ### SOD is free software; you can redistribute it and/or modify
13 ### it under the terms of the GNU General Public License as published by
14 ### the Free Software Foundation; either version 2 of the License, or
15 ### (at your option) any later version.
16 ###
17 ### SOD is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ### GNU General Public License for more details.
21 ###
22 ### You should have received a copy of the GNU General Public License
23 ### along with SOD; if not, write to the Free Software Foundation,
24 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 include $(top_srcdir)/vars.am
27
28 doc_DATA =
29 TEX_FILES =
30 BIB_FILES =
31
32 CLEANFILES += *.aux *.out *.log *.toc *.ind *.idx *.ilg
33 EXTRA_DIST += $(TEX_FILES) $(BIB_FILES)
34
35 V_LATEX = $(V_LATEX_@AM_V@)
36 V_LATEX_ = $(V_LATEX_@AM_DEFAULT_V@)
37 V_LATEX_0 = @echo " LATEX $@";
38
39 V_TEXMODE = $(V_TEXMODE_@AM_V@)
40 V_TEXMODE_ = $(V_TEXMODE_@AM_DEFAULT_V@)
41 V_TEXMODE_0 = batchmode
42 V_TEXMODE_1 = nonstopmode
43
44 V_BIBTEX = $(V_BIBTEX_@AM_V@)
45 V_BIBTEX_ = $(V_BIBTEX_@AM_DEFAULT_V@)
46 V_BIBTEX_0 = @echo " BIBTEX $@";
47
48 V_MAKEINDEX = $(V_MAKEINDEX_@AM_V@)
49 V_MAKEINDEX_ = $(V_MAKEINDEX_@AM_DEFAULT_V@)
50 V_MAKEINDEX_0 = @echo " MAKEIDX $@";
51
52 TEXFLAGS = --interaction=$(V_TEXMODE) \
53 --output-directory=$(abs_builddir)
54 BIBTEXFLAGS = --terse
55 MAKEINDEXFLAGS = -q
56
57 run_pdflatex = $(V_LATEX)cd $(srcdir) && \
58 version=$$(echo '$(VERSION)' | sed 's/~/\\textasciitilde /g') && \
59 $(PDFLATEX) $(TEXFLAGS) \
60 --jobname=$(basename $1) \
61 "\def\pkgversion{$$version}\input{$1}"
62
63 ###--------------------------------------------------------------------------
64 ### The manual.
65
66 ## The master file.
67 TEX_FILES += sod.tex
68
69 ## Main document styling and definitions.
70 TEX_FILES += sod.sty
71
72 ## The introduction.
73 TEX_FILES += intro.tex
74
75 ## Tutorial.
76 TEX_FILES += tutorial.tex
77
78 ## Reference.
79 TEX_FILES += refintro.tex
80 TEX_FILES += concepts.tex
81 TEX_FILES += cmdline.tex
82 TEX_FILES += syntax.tex
83 TEX_FILES += runtime.tex
84 TEX_FILES += structures.tex
85
86 ## Lisp interface.
87 TEX_FILES += lispintro.tex
88 TEX_FILES += misc.tex
89 TEX_FILES += parsing.tex
90 TEX_FILES += clang.tex
91 TEX_FILES += meta.tex
92 TEX_FILES += layout.tex
93 TEX_FILES += module.tex
94 TEX_FILES += output.tex
95
96 ## Other hacks.
97 TEX_FILES += cutting-room-floor.tex
98
99 ## Bibliography database.
100 BIB_FILES += sod.bib
101
102 ## Building the bibliography style.
103 EXTRA_DIST += mdwalpha.dbj
104
105 ## Spelling dictionary.
106 EXTRA_DIST += sod.words
107
108 ## Building the output documents.
109 MAINTAINERCLEANFILES += sod.pdf sod.bst babelbst.tex
110
111 if HAVE_LATEX
112 doc_DATA += sod.pdf
113 EXTRA_DIST += sod.pdf
114 sod.pdf: $(TEX_FILES) $(BIB_FILES)
115 $(call run_pdflatex,sod.tex)
116 $(V_BIBTEX)env \
117 BIBINPUTS=$(srcdir):$$BIBINPUTS \
118 BSTINPUTS=$(srcdir):$$BSTINPUTS \
119 $(BIBTEX) $(BIBTEXFLAGS) sod.aux
120 $(call run_pdflatex,sod.tex)
121 $(V_MAKEINDEX)$(MAKEINDEX) $(MAKEINDEXFLAGS) sod.idx
122 $(call run_pdflatex,sod.tex)
123
124 if HAVE_CUSTOM_BIB
125 BIB_FILES += mdwalpha.bst babelbst.tex
126 babelbst.tex: mdwalpha.bst
127 mdwalpha.bst: mdwalpha.dbj
128 (cd $(srcdir) && $(TEX) \
129 --jobname=mdwalpha \
130 --interaction=$(V_TEXMODE) \
131 --output-directory=$(abs_builddir) \
132 '\let\ifbatching\iftrue \input mdwalpha.dbj')
133 endif
134 endif
135
136 ###--------------------------------------------------------------------------
137 ### Maintenance rules.
138
139 fixup-wordlist:
140 { IFS= read -r hdr && echo "$$hdr" && \
141 LC_COLLATE=POSIX sort -f; \
142 } <$(srcdir)/sod.words >$(srcdir)/sod.words.new && \
143 mv $(srcdir)/sod.words.new $(srcdir)/sod.words
144 .PHONY: fixup-wordlist
145
146 update-symbols:
147 $(ASDF_ENV) $(RUNLISP) -L$(WORKING_LISPS) $(srcdir)/list-exports \
148 >$(srcdir)/SYMBOLS.new && \
149 mv $(srcdir)/SYMBOLS.new $(srcdir)/SYMBOLS
150 .PHONY: update-symbols
151
152 check-manual: update-symbols sod.pdf
153 $(srcdir)/check-docs sod.aux $(srcdir)/SYMBOLS
154 .PHONY: check-manual
155
156 ###----- That's all, folks --------------------------------------------------