Fix potential pointer use err in SI95
[ric-plt/lib/rmr.git] / doc / src / library / Makefile
1 #=================================================================================2
2 #       Copyright (c) 2019-2020 Nokia
3 #       Copyright (c) 2018-2020 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 XP = XFM_PATH=".:.."
19 P1 = $(XP) XFM_PASS=1
20 P2 = $(XP) XFM_PASS=2
21
22 # ----- generics  --------------------------------------------------------
23 # two pass builds in order to forward reference variables for figures and to insert
24 # table of contents in postscript output
25 #
26 %.ps: %.xfm
27         $(P1) pfm $< /dev/null
28         $(P2) pfm $< $@
29
30 %.md: %.xfm
31         $(P1) OUTPUT_TYPE=markdown tfm $< /dev/null
32         $(P2) OUTPUT_TYPE=markdown tfm $< stdout | sed 's/^ //' >$@
33
34 %.rst: %.xfm
35         $(P1) OUTPUT_TYPE=rst tfm $< /dev/null
36         $(P2) OUTPUT_TYPE=rst tfm $< stdout | sed 's/^ //; s/ *$$//' >$@
37
38 %.txt: %.xfm
39         $(P1) OUTPUT_TYPE=txt tfm  $< /dev/null
40         $(P2) OUTPUT_TYPE=txt tfm  $< $@
41
42 %.html: %.xfm
43         $(P1) OUTPUT_TYPE=html hfm  $< /dev/null
44         $(P2) OUTPUT_TYPE=html hfm  $< $@
45
46 %.pdf: %.ps
47         gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $<
48
49
50 # ----- lists  --------------------------------------------------------
51 # source common to all documents
52 common_src = index_snatch.im setup.im mbuf.im front_junk.im license.im
53
54 user_src = user.xfm advanced_use.im api_qref.im code_appendix.im code_send.im \
55         config.im failures.im general_use.im glossary.im
56
57 # user guide code examples
58 code_src = $(shell ls code_*.im)
59
60 rt_src = rt_tables.xfm
61
62 # output types for different builds
63 all_types = pdf md rst txt html
64 rtd_types = rst
65
66
67 # ------ rules --------------------------------------------------------
68 all:    $(all_types:%=user.%) $(all_types:%=rt_tables.%)
69         mv user.rst user-guide.rst
70
71 # just the things which are pushed to the docs scraper dirctory,
72 # renames to expected filenames where required.
73 docs:   $(rtd_types:%=user.%) $(rtd_types:%=rt_tables.%)
74         mv user.rst user-guide.rst
75
76 # dependencies; actual recipes are generic
77 $(all_types:%=user.%): $(user_src) $(code_src) $(common_src)
78 $(all_types:%=rt_tables.%): $(rt_src)  $(common_src)
79
80
81 # ---------- housekeeping ----------------------------------------------
82 # remove only intermeidate junk that might straggle; leave output
83 clean:
84         rm -fr *.bcnfile *.ca *.ecnfile *.sp *.toc
85
86 # Remove anything that can be built
87 nuke: clean
88         rm -fr *.ps *.pdf *.txt *.rst *.md *.html
89