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