Documentation fixes and revamp user guide
[ric-plt/lib/rmr.git] / doc / src / library / Makefile
1 #==================================================================================
2 #       Copyright (c) 2019 Nokia
3 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
4 #
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 #==================================================================================
17
18 # most things here require a two pass build, but these might be useful
19
20 %.ps: %.xfm
21         pfm $< $@
22
23 %.md: %.xfm
24         OUTPUT_TYPE=markdown tfm $< stdout | sed 's/^ //' >$@
25
26 %.rst: %.xfm
27         OUTPUT_TYPE=rst tfm $< stdout | sed 's/^ //' >$@
28
29 %.txt: %.xfm
30         OUTPUT_TYPE=txt tfm  $< stdout
31         OUTPUT_TYPE=txt tfm  $< $@
32
33 %.pdf: %.ps
34         gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $<
35
36
37 src = user.xfm advanced_use.im api_qref.im code_appendix.im code_send.im config.im failures.im general_use.im glossary.im index_snatch.im setup.im mbuf.im front_junk.im license.im
38 code_src = $(shell ls code_*.im)
39
40 all:    user.pdf  user.txt user.rst user.md
41
42 # two pass build for pfm to allow for toc insertion
43 user.ps: $(src) $(code_src)
44         XFM_PASS=1 pfm $< /dev/null
45         XFM_PASS=2 pfm $< $@
46
47 user.md: $(src) $(code_src)
48         OUTPUT_TYPE=markdown XFM_PASS=1 tfm $< /dev/null
49         OUTPUT_TYPE=markdown XFM_PASS=2 tfm $< | sed 's/^ //' >$@
50
51 user.rst: $(src) $(code_src)
52         OUTPUT_TYPE=rst XFM_PASS=1 tfm $< /dev/null
53         GEN_TITLE=1 OUTPUT_TYPE=rst XFM_PASS=2 tfm $< | sed 's/^ //' >$@
54
55 user.txt: $(src) $(code_src)
56         OUTPUT_TYPE=txt XFM_PASS=1 tfm $< /dev/null
57         OUTPUT_TYPE=txt XFM_PASS=2 tfm $< $@
58
59 # intermeidate junk that might straggle
60 clean:
61         rm -fr *.bcnfile *.ca *.ecnfile
62
63 # Anything that can be built
64 nuke: clean
65         rm -fr *.ps *.pdf *.txt *.rst
66